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

Alter MDAnalsysi.base.AnanlysisBase #35

Open
PicoCentauri opened this issue May 20, 2021 · 2 comments
Open

Alter MDAnalsysi.base.AnanlysisBase #35

PicoCentauri opened this issue May 20, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@PicoCentauri
Copy link
Collaborator

I know that @joaomcteixeira is not a fan of OOPing things but I will post this here anyway ;).
I thought about altering the base class with two new methods/attributes. A self.doc_dict attribute: a dictionary combining the docstring information and the callable signature. In principle, it is our

def parse_callable_signature(callable_obj, storage_dict):

as a class method.

And a self.save_results() method based on our general approach could be added if no such a function exists.

If we dynamically alter the analysis class we are parsing this could help to improve our workflow and will help users/developers that try to use our python implementation.

@PicoCentauri PicoCentauri added enhancement New feature or request help wanted Extra attention is needed labels May 20, 2021
@joaomcteixeira
Copy link
Member

I am fan of OOP where OOP adds value 😆

I see, you want to polymorph the Analysis class possible save_results() with our own saving engine so that later in the CLI we only need to do .save_results() and avoid the try:catch block. Is that it? It can be a good application.

self.doc_dict is bad. Better have a self.doc and self.sig.

We need to do this only after #17 and #28 are merged, otherwise become too messy. 👍

@PicoCentauri
Copy link
Collaborator Author

Yes first of all to avoid the try/catch block. But this could also help us to remove the "reparsing" in

mdacli/src/mdacli/cli.py

Lines 277 to 278 in 6334ac4

# Ugly that we have to parse again... but currently I have no better idea :(
params = parse_docs(analysis_callable)[2] # Index [2] for paramaters

and helps solving #32.

@PicoCentauri PicoCentauri self-assigned this Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants