Open
Conversation
Rewrite clean2d algorithm on Python See merge request cimm/public/chython!1
stsouko
reviewed
Dec 22, 2024
|
|
||
|
|
||
| __all__ = ['Calculate2DMolecule', 'Calculate2DReaction'] | ||
| from .clean2d import Calculate2DMolecule, Calculate2DReaction No newline at end of file |
Author
There was a problem hiding this comment.
fixed and additionally rechecked for operability
Clean2d python
Some property classes and properties that duplicate the existing functionality of the kayton were removed, and were made to improve the readability of the code, which allowed to optimize the algorithm The Vestor class for calculating coordinates and vectors was also improved, it was inherited from np.array and as a result a 2.5 times boost was obtained. Also some functions were improved, the changes were of the following nature - stylistic character - changes aimed at improving code readability - changes aimed at optimizing the algorithm (it was completely rewritten) - changes related to the replacement of property class analogs with the existing ones of the molecular container. - minor corrections of functions, in which calculation operations over coordinates and vectors took place, the same algorithm was rewritten, but adjusted to the optimized class already
a8121b1 to
07a933c
Compare
refactor clean2d on python See merge request cimm/public/chython!2
f4ef9e8 to
977900c
Compare
Author
|
Some property classes and properties that duplicate the existing functionality of the kayton were removed, and were made to improve the readability of the code, which allowed to optimize the algorithm The Vestor class for calculating coordinates and vectors was also improved, it was inherited from np.array and as a result a 2.5 times boost was obtained. Also some functions were improved, the changes were of the following nature
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All mentions of the old algorithm written in JavaScript have been removed. The file
chython/algorithms/calculate2d/clean2d.jshas been rewritten in Python, with new imports for the new algorithm, and moved tochython/algorithms/calculate2d/clean2d.py.All files containing JavaScript code have been deleted, and instead, new files have been added to the
chython/algorithms/calculate2d/folder.Calculate2d.pyis the main recursive algorithm that calculates the coordinates of the vertices of the molecular graph.KKLayout.pycontains the Kamada-Kaway algorithm, which is necessary for calculating the coordinates of bridged cyclic molecules.MathHelper.pyincludes auxiliary mathematical functions needed for calculations in the main algorithm, such as vectors and polygons (this will be completely replaced with an equivalent written using the NumPy library).Properties.pycontains auxiliary property classes for extending information about atoms, cycles, and bonds (this will soon be rewritten to reduce code repetition).