GSoC First Coding Phase

Sandeep Chauhan
3 min readJun 9, 2018

--

Hello there! Today we’ll discussed about the work of first coding phase of GSoC with Python Hydra. I have a lot of fun and great learnings during this period. I am very thankful for my co-operative mentors which helps me at many stages.I have also provided a brief description below for all four weeks works.

In First week, I read and understand the hydra-py implementation because I had to work on this repository and that’s implemented by using RDFlib. My next task was to set up the Redis environment locally and check it was working fine. So, my next task for first week along with above tasks was to fetch or load the data from the server like Api documentation(also called vocab) and data from the endpoints and etc. And I have done all these tasks in first week.

In Second week, Now my main task was to make graph in Redis to store the API structure from Apidoc but I became confuse with Api structure to Apidoc structure and I have written the code to implement a rough graph in Redis of Apidoc structure but then I realized that I have to store the API structure in Redis not the Apidoc structure. Then I have changed my whole code and tried to store a rough graph of API structure in Redis. But mine code was not follow pep8 guidelines. So, I have to change it according to pep8 guidelines.

In Third week, And now I was know that what I have to do because I have a rough implementation of my work. Now, my task was to use endpoints and fetch data from endpoint and store it into graph just like supportedProperty or the membes or collection of endpoints. Now graph was fully based on endpoints we had a node for every endpoint and object also. Now I have created a file with instructions how anybody can run code using Redis. Now my next task was to use hydrus instead of Apidoc directly and it had ability to do my work easier Now I was using hydrus.hydraspec.doc_maker instead of APIdoc for extract the endpoints, collection, class, supportedoperation and supportedproperty. These are all the tasks that I have completed in my third week.

In Fourth week, Now I have to make a bash script for Redis server environment which helps in running the code. First you need to run the bash file and bash file create and run the Redis server on your system then you can run the code. Now my task was to make the code modular and more readable So, I have write some comments and docstrings for every function and break the entire code into functions and modules (called collection_endpoints.py, classes_objects.py and hydra_graph.py) and also renaming the variables to use a good naming convention which is very important to make a code readable. Now I find an issue in graph that it should be more connected like if any endpoint or object have another class endpoint as a property in itself then there should be an edge between the endpoint and class endpoint(property). In this week, I have also setup a server on Google cloud and push some of the objects into it because the previous server that we are using have a lot objects and it takes lot of time in testing every time. Now we have a light server which have few objects in it and helpful in testing the code. I have also updated the code for remove some redundant information from graph and also add a property in for some node of graph is property value means if there is any terminal node then it should contain its property and its values. And I have also write some tests with the use of unittest which test the structure or format of data stored in Redis. I have also add few line of code in entire code which help in graph visualization. I am using graphviz module for the above purpose.

So, these are some tasks and work that I have completed till now and work is continue. If you want to about know the code then you should go through documentation of code and graph.

Other blogs related to that work:

  1. GSoC 1–2 week of coding.
  2. GSoC 3rd week of coding.

Thanks!

--

--

Sandeep Chauhan
Sandeep Chauhan

No responses yet