ARYAN_GUPTA's Blog

Week 8 : Testing Phase 1

ARYAN_GUPTA
Published: 07/27/2020

Hello Everyone!

What did you do this week?

This week I started working on writing tests. Tests are really important to software development. I read on about Pytest and concepts such as mocking. I had an idea of automating the process of clicking buttons, but I realised through the week that it wasn't going to be as easy as that. I had to make minor changes in my code to make it 'testable'. I could accomplish testing of KML Files parsing through lots of research and experimenting. I still have a long way to go!

What is coming up next?

This week will inevitably go into writing (better) tests, and increasing test coverage. I will do my best to provide tests for all the features that I've added in the past 2 months. There are certain other features that my mentor has asked me to modify in the KML Overlay. I will try working on them as well.

Did you get stuck anywhere?

 Writing Tests is quite tough. There is a certain mindset to keep while writing them. For example, I wrote a test designed to throw up an error in the software;all this time I was trying not to cause an error haha.. This is another role , from the other side of the mirror, that I need to get a hang of.

Looking forward to an interesting week :))

View Blog Post

Week 7 : Completion of Multiple KML Overlay UI

ARYAN_GUPTA
Published: 07/20/2020

After 7 weeks worth of coding, researching , experimenting and implementing, I have completed the KML Overlay UI! Feeling good, and quite confident now :))

A user can now do the following in the KML Overlay : 

  • Add and Load KML Files
  • Remove selected files, or remove all
  • Customize each file w.r.t color, linewidth
  • Overwrite the original KML with modified features
  • Merge multiple KML Files into one, and export as .kml file

What did you do this week?

On discussing with my mentors, I decided to finish off the last feature for the Overlay, i.e. the Merge KML Files feature. Looking at it, it looks like I only wrote 40 - 50 lines of code, but the whole week was spent researching and experimenting, so I could write the logic in those perfect 40  - 50 odd lines of code :))

Researching on the net, Merging KML Files is not a popular source of discussion. I barely found related material, and it was mostly based on combing KML/XML i.e. similar tags be grouped together. Since I wish to display lots of data on the map, it wasn't the feasible way. I tried out a lot of experiments : how to join different files, how to delete conflicting data (eg. namespaces), how to arrange the data in a human readable format as well.

I finally came up with the logic of copying elements from each file, inserting a new root of <Folder> on each of them, and putting them all inside a folder. Each file would have its namespace removed to avoid conflictions of data. And it worked!!

What is coming up next?

All major features have been completed. Its time to start writing tests! Its going to be really tough.. I have never written tests before, and I would have to write a lot of them to test the capabilities of my work :))

Did you get stuck anywhere?

The whole process of coding is getting stuck, researching, solving and moving on. I got 'stuck' implementing the logic for the above, as I was using lxml, and most of the resources online were using xml.ElementTree, which has quite stark differences. This led to me experimenting, and double checking each line of code that I wrote.

 

Looking forward to a great week! 

Thanks for reading :))

 

View Blog Post

Week 6 : Refining the KML UI Features

ARYAN_GUPTA
Published: 07/13/2020

Week 5 had been so smooth! I was covering up features daily. Progress was so sharp! I had around 3 to 4 features left to implement for this week. And my major part of the project would be over. And then it all went down.

'Most plans do not survive the contact with reality. Which isn't an excuse for not planning at all, but one shouldn't believe too much about projections into the future.' - Joern Ungermann , my mentor.

What did you do this week?

I started the week on a high, enthused with the smooth accomplishment of features everyday. My main task was to add a customize functionality to each KML File. Each KML File could have their own color, linewidth, and could be easily added, removed, displayed and saved. One simple task.

I could not do it.

I tried on Monday, wasnt able to do it. 'lets try tomorrow again". Tuesday, Wednesday passed. By Thursday, I was on edge; I wasn't making any headway in the feature, I hadn't updated my mentors. Thursday night, I realised what I had to do. And it literally frightened me. 

I had been using two different lists to store data. One list to run the files, another to run the patches for plotting. I realized, I had to change the data structure on which I had built the entire project.

I slept on it. Started working from Friday, day and night, replaced each and every part, transformed it all into a dictionary storing information about the file , patch , linewidth and colour. I worked all weekend on it. Sunday night, I was finally able to display individual color and linewidth for each and every KML File. I was so happy!! And the peaceful sleep that I had :))))

I could have just written " Finished adding functionality to customize UI for KML Files" , but somehow it just didnt do justice to my journey to achieve it :P

What is coming up next?

Now, I expect major features to be finished. I need to add "Merge KML File" functionality. Other than that, I need to write tests and collect KML samples to test out my features. So, I'll be working on that!

Did you get stuck anywhere?

I think I pretty much discussed it above. I had to rebase my entire project's data structure, and rebuild it into a dictionary, which after quite a lot of hard work, I was successfully able to do :))

See you next week!!

 

View Blog Post

Week 5 : Adding Functionality to the UI

ARYAN_GUPTA
Published: 07/06/2020

The first phase of coding is over, and I am really happy that I passed :)) 4 weeks back, I wasn't sure of my capabilities, but every day now feels good; like I am going to accomplish a lot! Every week has been productive, but this week, I was able to accomplish lots of features, which really made my mentors happy :)) 

What did you do this week?

Since the UI Design had been done, I spent this week adding functionalities to the buttons, removing bugs. Not sure if it would make sense without the UI, but here is what I did last week : 

  • Multiple Files can now be added simultaneously
  • Multiple Files can be displayed simultaneously
  • Extra buttons like Remove and Remove All for clearing the list
  • Double clicking on any KML file in the listWidget opens up a custom dialog box UI.
  • Bug fixing is done.
  • Single button "Add KML File" for adding & loading multiple KML Files simultaneously
  • Enhancement --> duplicate files are not loaded again.
  • Reduced Size of ListWidget; will get further removed after removing extra part of UI (colours, linewidth layout)
  • check uncheck feature to load KML layer

What is coming up next?

I am mostly done with the part, but still 2 3 important features are left and they are tough to implement : 

  • Add functionality to KML Overlay checkbox ( Disabled at the moment in UI)
  • Add functionality for customize UI for individual KML Files
  • Add functionality to Merge KML Files button

If I am able to do this, it would be a strong boost to my work, as I would be done with the main aim of my project! 
If time permits, I'll start writing tests too.

Did you get stuck anywhere?

I was on such a roll, that I wanted to finish the whole feature last week. But there is a method plot_kml, which has confounded me. Sometimes I think I understand it, but it slips out. Its crucial to the remaining features, so I have to work it out!

See you next week :))

View Blog Post

Week 4 : Working on the UI

ARYAN_GUPTA
Published: 06/29/2020

Hello there! Here's a quick update on my work this week, and then I'll hop back to it :P

What did you do this week?

I had designed a UI Dialog Box which opens on the press of a button. You could add the KML files to it, remove it , order it .. the works. However, as things go in development, the mentors suggested changes; the UI should be incorporated in the original UI. I was a bit sad, but I still made the changes. Now the UI looks good, and I admit, there wasn't much need of an extra UI element haha. (Listen to your mentors fellas!)

What is coming up next?

Some functionality is still left; Individual customization , loading multiple files and more! I will work on it, and hopefully be done with this section of my work by the end of the week!

Did you get stuck anywhere?

I am currently stuck at the Load push button. Its supposed to load all checked files, but its only loading the last checked file. Maybe its an overwrite situation, maybe something i overlooked? Stay tuned to hear more!

Update : Fixed it!

 

View Blog Post