I am excited to return with more to discuss as I continue to pursue a GIS certification. This is the first week in my GIS Programming course. In this week's lab, I learned about python, and I explored various environments for running python script including a built in notebook where scripts can be stored and run in ArcGIS Pro. I also created my first flowchart outlining the steps taken to convert 3 radians to degrees.
To generate the flow chart, I used https://app.diagrams.net/. I followed the flow chart template laid out in Agarwal et al 2010. Additionally, I used the same symbols for each component of the flow chart as well.
Additionally, I decided to research how to write the mathematical value of pi in a python script. I was opposed to rounding the value since it would give a slightly different outcome. During this research, I found that the best way to input pi into the script was to use math.pi which python interprets as the value for pi.
Lastly, I tested the script and steps laid out in the flowchart using a notebook in ArcGIS Pro.
The final step of this weeks lab was to read "The Zen of Python" and interpret it. “The Zen of Python” is a poem that outlines the tenets of writing python script. It highlights the importance of simplicity when writing scripts. It indicates that python scripts are more easily interpreted when the scripter takes time to clean the code and appropriately space the lines. The poem goes on to say that there will be temptations to “break the rules,” but the scripter should maintain the integrity of the script regardless. The poem ends by again highlighting the importance of seeking out the simplest solution to a problem. This poem is intended to be a reminder of the common pitfalls of writing python while also focusing on the factors important to successful python scripts.

No comments:
Post a Comment