Pedro Lacerda

Results 55 comments of Pedro Lacerda

My opinion is that we can test for each individual type like `List[str]`, `List[int]`, etc (e.g. `tp == List[str]`). But it would work different in Python and `.pml` scritps, except...

Now I'm checking the stacktrace with the `traceback` module if the last call before current is `parser.py`. It seems to work. I need to capture errors from `cmd.do`, but pytest's...

@TstewDev > `scene_order` is a good example of what I was thinking of for the option to either provide a list or space separated string. I think this is reasonable...

I couldn't make `*args` and `**kwargs` works in a sane way, so I'm giving up to parse commands like [`spectrumbar`](https://github.com/Pymol-Scripts/Pymol-script-repo/blob/ab0762d7cbf5fb004c28791b213ebfc259498345/spectrumbar.py#L9) . It could always be declared with `cmd.extend`. I'll remove...

Here the updated code with autocomplete for Selection and Path. ```python from pathlib import Path @declare_plugin def f(a: int, b: Path='/tmp/'): return f'{a} {b}' ``` ```python class Selection(str): pass AUTO_ARGS...

Sample plugin command: ![image](https://github.com/schrodinger/pymol-open-source/assets/149358/ded19a52-c18e-48a9-a601-1d043a2d4e49) More examples: https://gist.github.com/pslacerda/1e6a14cbe3fc7aeb2425e0a5d74ddc78

@JarrettSJohnson @speleo3, I'd like to work on this enhancement feature, can I?

Yes, it is based the current approach with decorators. It provides autocompletion for `Selection` args; does 'yes/no' conversion on `Boolean`; cast the args to the enforced types.

It is mostly mypy compatible and wrong only when the argument is with `Bool`/`bool`. ![image](https://github.com/schrodinger/pymol-open-source/assets/149358/e9000cd4-aa66-48c7-915d-eefb51668f74)