-
Notifications
You must be signed in to change notification settings - Fork 314
Improvements on the @cmd.declare_command
API
#448
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: master
Are you sure you want to change the base?
Conversation
I'll ask if we can maintain our pattern of keeping tests in |
Sorry, it was my bad. I'll tackle this in a few days. |
80eb0ce
to
7c9f7ff
Compare
@JarrettSJohnson I'd like to ask, should I proceed and refactor existing commands to adhere the |
The first step is to refactor the |
We can address that in a separate PR, if possible. Also I think some things were accidentally deleted, perhaps during the merging process? (e.g. |
7c9f7ff
to
095e961
Compare
The tip of branch were based on an old commit. It took me several hours to finish this git chore task. |
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.
Generally looks fine to me, I was under the impression from the original PR that this would just be for extended, custom functions rather than native ones. I'm a little hesitant to change current commands just yet. I still need to play around with this first to ensure no functional changes.
@@ -1,50 +0,0 @@ | |||
import sys |
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.
Was this file intended to be removed here?
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.
Yes. Is it ok?
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.
Please keep for now since we still have code that uses this pattern.
Me too. Except for the |
- Bio.pairwise2 has been deprecated -> Use Bio.Align.PairwiseAligner instead - SeqRecord constructor: Using a string as the sequence is deprecated -> Convert to Seq The changes are based on https://github.com/speleo3/pymol-psico/blob/ae2b92c262bc/psico/seqalign.py
If I remove the docs-on-comment feature will this be merged faster? |
Apologies. Give me until the weekend, and I'll come back to this review. My involvement with incentive and open-source comes in waves, and I'm still pretty deep in 3.2/3.3 work. |
I think this is important to get merged before 3.2 because otherwise will have a delay starting in the current incomplete feature awaiting 3.3. |
@@ -1,50 +0,0 @@ | |||
import sys |
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.
Please keep for now since we still have code that uses this pattern.
break | ||
i += 1 | ||
else: | ||
i -= 3 |
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 don't think I follow this line
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.
Me neither, I just placed it here because was needed. I'd need to debug to remember exactly, but seems to me that it's related to rewind the cursor i
when no doc is found.
modules/pymol/commanding.py
Outdated
|
||
raise pymol.CmdException(f"Unsupported argument type {type}") | ||
|
||
def parse_documentation(func): |
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 think this function probably needs its own unit test as well. The API to me is not inherently clear.
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.
It is tested integrated with declare_command
on test_declare_command_arg_docs
.
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 understand, but something like this probably deserves its own test too if possible. I'll make it optional, but I will likely add it later.
Give me some days and I'll fix according to your review. As nobody is using this yet, including me, may |
Sure. |
A write a bunch of tests and did my best to achieve best ergonomic API.
Only optional (
None
) data is still failing in some cases.