Welcome. My name is Lucky
This is my second devlog, based around a project (my first personal one) in python that predicts molecular and overall shape geometries using Valence Shell Electron-Pair Repulsion Theory– VSEPR (check my first devlog if you seek more information). The following is what I have done, in simple terms. I have:
- Counted the Valence Electrons of the inputted molecule using mendeleev.
- Accounted for charges on molecules and taking that into consideration while calculating Valence Electrons.
- Error checked / parsed the user’s input to only allow valid molecules.
-
Calculated electronegativities of constituent elements (using mendeleev) and determining the central atom of the molecule.
Challenges:
It was hard to parse the user’s input, and organizing code in respect to the type of the user’s molecule (e.g., if it has a charge that isn’t 0 or not). This way, it was hard to check whether my code was breaking other code. I remember accounting charges for my valence electron total– I was so happy and I felt very accomplished. However, I realized that I couldn’t input zero-charge molecules anymore– simple ones like H20 or CO2 . . .
This is why I am going to decide to make a test file using pytest. (I may even have errors in my code I haven’t found yet.) I won’t have to go through this struggle again: testing and testing and testing. Rather, I can just run a single line in my terminal and test my whole file easily. That said, I will still need to change some things in order for that to happen– which leads me on to what I hope to achieve in the near future in terms of this project.
Goals for next sessions: - Create actual functions with respective function (obviously, haha), so I can use pytest.
- Overall clean up code
- Start abstractly creating a lewis structure– I don’t know yet if I will actually draw it on the screen.
- Calculate the amount of covalent bonds needed from the central atom to terminal atoms, and account 2 electrons for each bond.
Thanks for reading, I hope you learned something or found my post interesting. I included a screenshot below of my project’s output for now.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.