Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for branches and much more #6

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Support for branches and much more #6

wants to merge 7 commits into from

Conversation

harshil21
Copy link
Owner

@harshil21 harshil21 commented Aug 29, 2020

Progress towards naming branches:

  • Make an internal mapping of carbon atoms with each other.

  • Use that to map every single possible route the program can take to get the longest carbon chain.

  • Update valency_checker() for branched compounds.

  • Add set of basic rules to decide substituent length and positions.

  • Transform the structure to the correct one.

  • Actually start naming the compound.

Additional features:

  • Add __iter__() and __next__() for looping through the compound.

  • Add __len__() which gives length of compound (no.of carbon atoms)

  • Provide attribute for molar mass of compound.

  • Provide the user a way to draw compound, and then insert that drawing into CompoundObject().

Merging requirements:

  • Add test cases

  • Documentation

  • Add licenses

  • Configure setup.py to include optional graphical package.

No major changes, just reshuffling, will come back and work on this soon. (stuff might be broken here)
to_dict() doesn't map a branch within a branch yet, will add in future commit.

- Add __len__(), __iter__(), and __next__() methods.

- Some reorganizing and added temporary test cases.
@harshil21 harshil21 added the enhancement New feature or request label Aug 29, 2020
@harshil21 harshil21 self-assigned this Aug 29, 2020
- Added `molar_mass` as attribute for `CompoundObject`

- Made `carbons`, `hydrogens` and `molar_mass` read-only using @Property decorator.

- Added special dunder methods for <, >, <=, >=, ==, !=

- Made .gitignore even with master.
- Added the Element class, now the smallest unit of a compound.

- Iterating through the compound now yields Element objects.

- Valency checker now works with branches(incl. nested ones)

- ValencyError now also shows where your mistake is.

- Calculate longest path using Depth First Search tree traversal.

- Adjacency list now accounts for bonds and nested branches. Each node is an Element object.

- Compound comparisons now work with integers and floats too.

- Added some type hints.

- Major performance improvements.
- Added unit tests via pytest and improve coverage.

- Speed up valency_checker by ~40%

- Add CompoundObject to __all__

- Fixed a tiny bug.

- Some refactoring.
@harshil21 harshil21 mentioned this pull request Oct 5, 2020
@harshil21 harshil21 linked an issue Oct 5, 2020 that may be closed by this pull request
@harshil21 harshil21 added the bug Something isn't working label Oct 6, 2020
@harshil21 harshil21 added this to the v0.6 milestone Oct 6, 2020
@harshil21 harshil21 marked this pull request as ready for review October 6, 2020 05:17
- Now derive carbon prefixes using the method described in P-14.2.1.2. This removes 20 carbon limit and now allows naming upto 10,000 carbon atoms.

- Fixed #7

- Moved compound.py and element.py into base dir
totally broken right now, this was committed to 'save' it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong PIN(s)
1 participant