Hello, World.
It’s been a while.
Welcome to the 5th devlog centralized around a (mainly python) project that uses VSEPR Theory– aka Valence Shell Electron Pair Repulsion Theory– to predict the shapes/geometries of given molecules. For more info on the project’s main aims, please read my previous devlog. Nevertheless, a bulleted summary of what the project can do (structured in a way similar to my other devlogs for simplicity) is shown below.
Capabilities of the Project
This project, at its state at the moment of writing:
- Counts Valence Electrons of the inputted molecule (mendeleev assist).
- Accounts for charges on molecules and taking that into consideration while calculating Valence Electrons.
- Error checks / parses the user’s input to only allow valid molecules. * NEW/ADDED
- Calculates electronegativities of constituent elements (using mendeleev) and determining the central atom of the molecule.
- Parses the molecule to find its elements and subscripts.
- Calculates electron groups / steric number.
- Calculates lone pairs around the central atom.
- Reforms the molecule in VSEPR form: AX_mE_n.
- Searches through a dictionary/table of all of the permutations of VSEPR form in order to fetch appropriate data.
- Interacts with the user in order to act as an educational tool. * NEW
- Allows the user freedom in the questions asked: they can ask for a hint, can skip 1 questions, and can skip all questions at once.
The Radical Problem (literally. (solved))
A major mistake on my part was that I forgot to account for radical molecules; in fact, I didn’t even know they were a thing. It turns out that, some molecules are allowed to have a lone electron surrounding the central atom, since they have an odd number of total valence electrons, hence yielding them an inevitable 1 leftover electron. Thankfully, the problem is solved now, perhaps in an admittingly unfortunate way: the program is now designed to simply reject radical molecules. There is a good reason for this, and that’s because these molecules’ shapes cannot reliably be predicted with VSEPR theory.
The Clean Up
In the time in between my 4th and 5th devlog, I have spent a lot of time capturing bugs in my code, and cleaning the code along the way. For a simple example, I would lazily copy-and-paste the same code into each constituent if, elif, and else statement when I could just call that code after them. As it’s been a relatively long time, I cannot remember a lot of the specific clean-ups I had done, which is probably included in the **cons of pushing devlogs late . . . **
I apologize for the late devlog (although I know not many care). The reason for this, and the low amount of hours and effort given in these past 13 days, is mostly because of school. As well as there was a problem with my hackatime or rather my VSCode wherein multiple hours of work were not logged for whatever reason– however, I worked with quality during those times so I consider it a win.
Addressing the Functionality (the interactivity)
For now, my project asks questions to the reader terminal style, being arguably not engaging and probably very indescriptive as well– which is important to take note of, as this is indeed supposed to be an educational tool. In my future plans, I hope to pick up on some JavaScript or TypeScript, HTML, and CSS, in order to create a website or application that actually renders the models of these molecules, as well as to provide models for constituent steps like creating the Lewis/Dot structure. I firmly believe that if we are building the Dot Structures and are predicting shapes of molecules, the users should be able to see these things so they can then understand.
Conclusions
Thank you for reading!
This was the 5th devlog, on the project based around VSEPR Theory, and I’ll see you, next time.