Wednesday, June 14, 2017

GIS 5103: Module 4- Debugging & Error Handling

Good afternoon UWF,

This week's lab dealt with using the Debugger tool in PythonWin to address fixing errors.  I found this lab to be semi-helpful in my continuing struggle to understand how Python (and basic computer programming) works in this type of environment.  I didn't find the debugger tool to be too helpful, but I did appreciate how the lab parts required to step through each line of code sometimes to see what errors were still existing.  This broadened my horizons on trying to interpret what some error codes mean and how to possibly fix them.  I am still not confident in my programming abilities up to this point, but I thought that this lab was a little easier than some previous labs so hopefully that means that I am catching on a little bit.

The lab was split into three parts.  The first part involved identifying two errors residing in a short span of code.  These errors were easy to find as they were of the spelling/syntax variety.  I am including my properly edited code and Interactive Window screenshots for each part of the lab to help me maybe identify trends going forward.  The Part 1 screenshot is below.


Part 2 was the most difficult of the lab in my opinion.  There were eight errors/exceptions to identify and I failed to find all of them.  I was unable to complete this section.  Errors that I had to fix that I wouldn't even consider errors involved updating some paths for data and mxd's listed in the code.  I think that I was supposed to have my data saved in paths to match what is shown on the code but I'm not sure?  I found a few syntax errors but couldn't really get past line 16 without getting stuck.  I actually started this section and left it for a while, moving on to Part 3.  After doing ok in Part 3, I was hoping to feel rejuvenated in being able to complete Part 2 but alas, I didn't get much further before calling it quits.  I will look forward to the lab grade feedback to see what I am missing in this section.  The Part 2 screenshot is below.


Part 3 involved making the code run even though an error was present.  Using the textbook was helpful for figuring out how to make both parts run.  This part involved placing a try-except statement into the code to make it run.  One interesting thing that I noted is that my Map Scale shows a different number compared to the lab example.  I don't know if that is a big deal or not but I am not going to bother to see if that matters for now.  Part 3 screenshot below.



Looking forward at future labs, I feel a little better because we will be incorporating ArcMap more and ModelBuilder.  I will just feel more comfortable working in an Arc environment as opposed to Python.  Hopefully I will feel more confident as this lab transition occurs.

-Matt Griggs

No comments:

Post a Comment