Posts

Showing posts from December, 2020

The End of Release 0.4

To finish separating the code into modules I had to take some time to approach how I was going to deal with passing all the data that needed to move around. After reviewing the code, I found that the biggest barrier to moving the code was that a lot of functions passed data that it didn't necessarily need to use to another function that was called in it. I believe this is why the owner of the project decided to use global variables to provide a solution to this issue. But with how I wanted to arrange the modules using global variables would not work so I needed to find a way another to get around this.  I tried a few different solutions to this problem. The first thing I tried was to try cutting down on the number of functions that were used by repurposing a few functions so that they could be reused more than once. This worked for a few functions but the way the code was written it didnt really solve the problem as the amount of parameters the functions started to have were gettin

Release 0.4 Progress - Organizing the code

 After taking some time to understand the code that runs the bot, I was able to separate the code out into a few different categories that would be placed into their own files, code that creates the classes that manage the checking of reddit posts and comments, code that manages the bot streaming and posting to reddit, code that initialized the initial state of the bot and code that provides general utility to the bot.  Once I was able to separate out all that logic, the next issue I need to tackle now is how to make the code work while flowing through these different files. Currently since the app operates in one file, the bot creator has been making use of a lot of global variables instead of constantly passing variables through several functions. I dont think this solution is ideal so I currently I am working on a more efficient solution that doesnt involve passing several variables across functions and files. I think perhaps creating a dictionary that contains critical data that ca

Planning for Release 0.4

 For this final release I was able to find a project that has created a reddit bot that scans titles in reddit subreddits and if it matches the criteria laid out in the code it offers the poster some useful resources and/or some great projects to begin practicing coding. I thought this was a worthwhile project as this is something that would definitely be helpful to me and it seems like a great addition to the programming  community.  The specific issue that I wanted to work on was one were the creator of the bot had all the code for the bot basically in one python file and the file was growing to over 500 lines and he wanted to move to a more modular approach that would include separating out the logic into different files. I thought this would be a good issue to tackle because it would require me to get a full understanding of the code as well as add optimizations throughout while a separated out the code.  The approach I plan to take is first to review the code so I can get a more

Offering Some Help - Release 0.3 PR1

Introduction For this pull request, I searched for a project using the help wanted tag on github. Eventually I found a project that seemed like I would be able to help with. It was a CLI that would take in a file with pseudo code and convert it to python code and run it. This seemed like an interesting concept as well as something that I would be able to help with.  Issue The issue I decided to help with was one were the correct CLI did not have any way to convert two expressions being compared with a logic gate, for example X > Y AND X< Z. They CLI already had a function that compares to variables with an operator so building on that functionality was the task.  Pull Request  Making this functionality work involved creating a new function that would receive two arrays and string that represented the logic gate. Each array would contain two values and an operator which when then be passed to the compare function that already existed. Once the outcome of calling the compare functi

Final PR for Release 0.2

Introduction For this final pull request I wanted to work with something different as I had been working on a lot of python based projects. So after doing a search I was able to find a project that was creating buttons for the web that seemed interesting.  Issue The issue was that the css for the buttons was only triggering the animations on hover but some of the animations needed to happen without a hover. The solution was to add an animation class to the css and change the files for the button as well as the main css to match. The issue said to just comment below which buttons from the list you wanted to work on, so I choose a few buttons to get started and the developers gave me the okay.  Pull Request Once I began to work on what the issue required me to do, I noticed that the changes were much more simple than I had anticipated. I just needed to add the .animated line of code under the buttons I had requested in the main css file as well as add it to the individual css for the bu

Packaging my CLI

 Creating a Python Package The first steps I had to take to package my python CLI was to reorganize my directory structure. This involved moving my main python files into a separate folder and after running into some errors I also had to change the import statements in those python files to match the changes made to the directory. Once that was done I was ready to begin packaging my CLI. In this guide  I used the next steps were to update my setup.py so it could be used in the next steps to create my package. In my setup.py I had to include all the other packages that needed to be installed to run my CLI, as well as open and read my  README file to be included as well. Once my setup.py was ready I was no ready to create my package by using the setuptools and wheel package with the command  python3 setup.py sdist bdist_wheel. This command created to files in a dist folder, the first file was the source distribution and the second file was the built distribution. Now my package was ready

Release 0.2 3rd Pull Request

Introduction For this pull request, I wanted to build the confidence to work with a larger open source project. I was able to find the perfect oppurtunity to build my confidence in working in larger more complex projects with Pandas. Pandas is a data analysis tool that I have used before with python and it was powerful and highly recommended so contributing to the project was something that really interested me.  Issue  The code base for pandas was pretty complex and intimidating so for my first contribution I wanted to find an issue that was fairly simple just so I could get a feel for the contributing process for such a larger project. I was able to find an issue that had been filed that was marked as good for first time contributors. The issue  was that they had several files that they wanted to move away from using dict() to create dictionaries and instead used python literal dicts to avoid having to ignore the flake8 errors they caused. Fixing this would be fairly simple so I pick