Refactor: Modularize mol3D class into a package with I/O, geometry, and vectorized methods#538
Open
sniderg wants to merge 3 commits into
Open
Refactor: Modularize mol3D class into a package with I/O, geometry, and vectorized methods#538sniderg wants to merge 3 commits into
sniderg wants to merge 3 commits into
Conversation
| import re | ||
| import sys | ||
| import time | ||
| import tempfile |
| s = xyzstring.split('\n') | ||
| try: | ||
| s.remove('') | ||
| except ValueError: |
| s = filename.split('\n') | ||
| try: | ||
| s.remove('') | ||
| except ValueError: |
| with open(filename, 'w') as f: | ||
| f.write(mol_contents) | ||
|
|
||
| def writemol2(self, filename, writestring=False, ignoreX=False, force=False): |
Comment on lines
+728
to
+734
| def writemol2_bodict( | ||
| self, | ||
| ignore_dummy_atoms=True, | ||
| write_bond_orders=True, | ||
| return_string=True, | ||
| output_file=None | ||
| ): |
Comment on lines
+924
to
+926
| def writexyz(self, filename, symbsonly=True, ignoreX=False, | ||
| ordering=False, writestring=False, withgraph=False, | ||
| specialheader=False, no_tabs=False): |
Contributor
|
Hi, this is a good idea. I am a bit swamped so I am unsure when I can get around to fixing it for the tests, if you get time let me know. In the meantime I will let the pull stand as I don't want to close it yet since I think this is a good approach for a class as dense as mol3D. Best,
|
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.
Converts
mol3D.py→ mol3D/package with
core.py, io.py, geometry.py
Extracts 20+ I/O methods and geometric transforms into mixin classes
Vectorizes centermass, centersym, adds get_coords_matrix()/ get_mass_vector()
Fixes writemol2 bug: missing bond_count increment when bond orders present
Full backward compatibility — zero import changes needed