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

Raise error when changing workflow properties after compilation #199

Merged
merged 4 commits into from
Mar 13, 2023

Conversation

raulconchello
Copy link
Contributor

Implemented a new decorator for the setter methods of the workflows.

This decorator will check if the workflow is compiled, if it is then raises an error.

The decorator is the following:

def check_compiled(func):
    def wrapper(self, *args, **kwargs):
        result = func(self, *args, **kwargs)
        if self.compiled:
            raise ValueError("Cannot change properties of the object after compilation.")
        return result
    return wrapper

Tests implemented too

@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

Merging #199 (1e66c0e) into dev (9d39cb1) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #199      +/-   ##
==========================================
+ Coverage   88.79%   88.84%   +0.05%     
==========================================
  Files          32       32              
  Lines        5799     5827      +28     
==========================================
+ Hits         5149     5177      +28     
  Misses        650      650              
Impacted Files Coverage Δ
tests/test_analytical_simulator.py 100.00% <100.00%> (ø)
tests/test_workflows.py 99.51% <100.00%> (+0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@vishal-ph vishal-ph merged commit 86b0059 into dev Mar 13, 2023
@vishal-ph vishal-ph deleted the dev_warning_set_after_compile branch March 13, 2023 04:58
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