Tuesday, May 14, 2024

Module 1- GIS Programming- Python Environments and Flowcharts

 The first week of GIS Programming has commenced. I was nervous going into this class as I have no coding experience, but I am excited to learn something new. This week we learned the very basics of python and practiced making flowcharts. Our first task was to run a pre-scripted code that created all the folders we would need for the course. As I looked at the code, I noticed how easy it would be to slightly alter this code to use for other courses, assuming one was following a consistent folder pattern for each module. I find the functional aspect of coding interesting because I haven’t understood or considered all the different tasks it can be used to streamline before now.

One aspect of coding I think is less intuitive to me at this point is knowing what values to define. I could easily see myself forgetting to define a value when setting up my codes, especially as the codes get progressively more complex. I presume that it will become more instinctive with time/practice. In the case of this week’s assignment, which was to create a flowchart for a simple math calculation, it was such a different way of looking at a simple math problem- having to input each piece separately before putting it all together. When I began putting my flowchart together, I was unsure if “pi” would be a known or unknown variable in python so decided to test it by running the code to determine degrees based on my flowchart. It told me that there was an “error” with variable the variable “pi”. I tried again but added that pi=3.14159 and it gave me to output so I made sure to define that variable to my flowchart. I had run a google search before “testing” my equation and found that there is some way to use a math module or library that would allow me to simply use “pi” without declaring it but for the purposes of this lab didn’t investigate it further since we weren’t tasked with running the code at this time. However, I do want to follow up and figure out how that works at a later point if it is not covered in future labs.

A flowchart depicting the calculation of degrees when radians=3

Our last task was to access and read “The Zen of Python” and share what we think it means. I read “The Zen of Python” as a set of guidelines to consider when developing scripts using this program. It makes clear that the developers of python value clarity (with statements such as “explicit is better than implicit”), and simplicity (by defining a simple>complex>complicated hierarchy, and a preference for sparse over dense and flat over nested). This work makes clear that the purpose of python is not flashy/overcomplicated scripts but rather the beauty of python lies in ease of use. Fortunately for me, this challenges my previously contrived ideas of what coding would look like as I imagined it to be a very difficult, complicated process.


No comments:

Post a Comment

GIS Portfolio

 We were tasked to create a GIS portfolio for our internship program. It was a great opportunity to put organize the work I have been doing....