Skip to content

🔧 FIX auto_persist decorator typing#239

Merged
chrisjsewell merged 2 commits intoaiidateam:masterfrom
chrisjsewell:fix-typing
Oct 12, 2022
Merged

🔧 FIX auto_persist decorator typing#239
chrisjsewell merged 2 commits intoaiidateam:masterfrom
chrisjsewell:fix-typing

Conversation

@chrisjsewell
Copy link
Copy Markdown
Member

@chrisjsewell chrisjsewell commented Oct 12, 2022

This is used in aiida-core,
to decorate the WorkChain class.
The problem currently is that, because of the decorator typing,
no methods defined on subclasses of Savable
are available for static analysers (such as IDE auto-completions).
This change ensures the output of the decorator is the same as the input.

This is used in aiida-core,
to decorate the `WorkChain` class.
The problem currently is that, because of the decorator typing,
no methods defined on subclasses of `Savable`
are available for static analysers (like IDE auto-completions).
This change ensures the output of the decorator is the same as the input.
@chrisjsewell chrisjsewell requested a review from sphuber October 12, 2022 09:16
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 12, 2022

Codecov Report

Base: 90.46% // Head: 90.46% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (e4efc9e) compared to base (8c7640b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #239      +/-   ##
==========================================
+ Coverage   90.46%   90.46%   +0.01%     
==========================================
  Files          21       21              
  Lines        2953     2954       +1     
==========================================
+ Hits         2671     2672       +1     
  Misses        282      282              
Impacted Files Coverage Δ
src/plumpy/persistence.py 93.93% <100.00%> (+0.02%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@chrisjsewell
Copy link
Copy Markdown
Member Author

and obviously I tested this fix works, in the context of VS Code:

image

(this does not work currently)

@sphuber
Copy link
Copy Markdown
Collaborator

sphuber commented Oct 12, 2022

and obviously I tested this fix works, in the context of VS Code:

How does this show that it is working? The to_context method is not decorated with auto_persist is it?

@chrisjsewell
Copy link
Copy Markdown
Member Author

chrisjsewell commented Oct 12, 2022

The to_context method is not decorated with auto_persist is it?

No, the whole WorkChain class is decorated with auto_persist

How does this show that it is working?

This is it without the change, all it knows is that wc is a Savable

image

image

@chrisjsewell chrisjsewell merged commit 7a218ac into aiidateam:master Oct 12, 2022
@chrisjsewell chrisjsewell deleted the fix-typing branch October 12, 2022 10:28
unkcpz pushed a commit to unkcpz/plumpy that referenced this pull request Dec 14, 2024
This is used in aiida-core, to decorate the `WorkChain` class.
The problem currently is that, because of the decorator typing,
no methods defined on subclasses of `Savable`
are available for static analysers (like IDE auto-completions).
This change ensures the output of the decorator is the same as the input.
agoscinski pushed a commit to agoscinski/plumpy that referenced this pull request Apr 13, 2026
This is used in aiida-core, to decorate the `WorkChain` class.
The problem currently is that, because of the decorator typing,
no methods defined on subclasses of `Savable`
are available for static analysers (like IDE auto-completions).
This change ensures the output of the decorator is the same as the input.
agoscinski pushed a commit that referenced this pull request Apr 13, 2026
This is used in aiida-core, to decorate the `WorkChain` class.
The problem currently is that, because of the decorator typing,
no methods defined on subclasses of `Savable`
are available for static analysers (like IDE auto-completions).
This change ensures the output of the decorator is the same as the input.
agoscinski pushed a commit that referenced this pull request Apr 13, 2026
This is used in aiida-core, to decorate the `WorkChain` class.
The problem currently is that, because of the decorator typing,
no methods defined on subclasses of `Savable`
are available for static analysers (like IDE auto-completions).
This change ensures the output of the decorator is the same as the input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants