-
Notifications
You must be signed in to change notification settings - Fork 1
Files renaming and refactor of Complex
into Complex
and Chain
and renaming of files.
#6
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
base: main
Are you sure you want to change the base?
Conversation
…al functions to understand inner workings better.
…y for easy understanding and structure.py is the base class upon which everything builds.
Complex
into Complex
and Chain
@fkiraly I wanted to just open a PR for getting review for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR performs a comprehensive refactoring of the MAWS codebase, moving from flat module structure to a proper package layout with modernized Python typing. The changes include:
- Converting from old-style to modern Python typing (e.g.,
List[str]
→list[str]
) - Renaming files from PascalCase to snake_case and moving them into a
maws/
package - Splitting the monolithic
Complex.py
into separatecomplex.py
andchain.py
modules - Refactoring code style and imports
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
File | Description |
---|---|
pyproject.toml |
Removes author information temporarily |
maws/structure.py |
Modernizes typing and code style |
maws/space.py |
New file with geometric sampling spaces |
maws/routines.py |
Statistical calculation functions |
maws/rna_structure.py |
RNA residue templates with modern typing |
maws/prepare.py |
AMBER library preparation utilities |
maws/maws2023.py |
Main MAWS algorithm with updated imports |
maws/kernels.py |
Numba-optimized computational kernels |
maws/helpers.py |
Unit conversion and geometry utilities |
maws/dna_structure.py |
DNA residue templates with modern typing |
maws/debug.ipynb |
New Jupyter notebook for debugging |
maws/complex.py |
Complex class for managing molecular systems |
maws/chain.py |
Chain class for polymer chains |
maws/tools.py |
External tool execution utilities |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
maws/complex.py:1
- The condition checking
element[2] is None
andelement[2] == 0
after the loop that modifieselement[i]
creates unreachable code. Theelement[2] is None
check should occur before the loop that normalizes negative indices.
# maws/complex.py
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
note from earlier today: cany ou kindly add a PR description with a request what to review? |
Sorry , adding right now, I keep forgetting
|
Complex
into Complex
and Chain
Complex
into Complex
and Chain
and renaming of files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
I think this is quite hard for me to review, given that I am not certain where or how to use these classes.
Can you please ensure that you have a full docstring, and usage examples of the new Complex
class at least?
@fkiraly I have added docstrings for I would recommend only going through |
OpenMM integrator (defaults to Langevin). | ||
simulation : app.Simulation | None | ||
OpenMM Simulation wrapper with context. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for a full review, I am missing an example how this class gets used, or generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am working on adding those, The implementration of Complex class is here , since one of these methods depend on make_lib from prepare.py
which depends on ambertools, and I am getting Path errors which I am trying to resolve ,once that happens it would be easier to understand the method.
* each chain's LEaP ``init_string`` (``loadoff``/``loadamberparams``), | ||
* each chain's *canonical* sequence (after alias translation). | ||
- External tools must be discoverable on ``PATH``. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arguments of __init__
should be described in a Parameters
section
LEaP ``source`` line for the aptamer FF (e.g., RNA.OL3/DNA.OL21). | ||
force_field_ligand : str | ||
LEaP ``source`` line for the ligand/protein FF (e.g., ff19SB or gaff2). | ||
structure : None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I understand the question correctly but these leap commands are passed to tleap
via prepare.py
make_lib
functions which further run tools.py
commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, I think the code is currently much clearer!
I have no major reservations with respect to the structure - it also looks quite close to the original high-level architecture.
Some questions:
- do I understand correctly that
Complex
is using a builder pattern? - what are the main differences to the previous file,
Complex.py
? - is it correct that:
Complex
containsChains
(and gets more through builder pattern), andStructure
is whatcomplex
is built from? - architecturally, where are the interfaces to files in the entire set of classes?
- how do the
rotate_
methods inComplex
andChain
relate? IfChain
s are part ofComplex
why doesrotate_
not also rotate them? Or does it?
Requests:
- usage examples would help a lot with the review, i.e., intended usage. Is there currently already such code? I assume you must have been using something like that for testing.
- in the methods, could you at the top always say what attribute they exactly modify in
self
? E.g.,add_chain
modifiesself.chains
. - not blocking, but maybe helpful: would you be able to do the rename of
Complex
tocomplex
etc already inmain
, and have this PR only change the contents? It would make review easier, as the diffs are easier to obtain.
About requests
|
@fkiraly I hope this would be easier to review better than before, especially the renaming files are sorted, working on rest of requested changes. |
I meant, is
I meant, where are files being interfaced? In which functions, classes, methods precisely?
Ok, that is your test workflow then and primary vignette, just to confirm? |
2 .
|
Also, I have added docstrings in Also at this point the architectural design of |
The PR makes the following changes :
Complex.py
intocomplex.py
andchain.py
.chain.py
.Note : For the purpose of this PR, only
chain.py
needs to be reviewed, rest all of the files still need to be refactored and docstrings to be addded.