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

feat: allow unary subtraction operator in SEDML validation #139

Merged
merged 2 commits into from
May 19, 2023

Conversation

jcschaff
Copy link
Member

What new features does this PR implement?
While validating SEDML documents, the evalidate library is used to check mathematical expressions used in a SEDML document (e.g. within FunctionalRange math). This validation does not permit use of the unary subtract operator which is common and safe. This maps to the Python AST as 'USub'.

What bugs does this PR fix?
This fixes the validation of several Virtual Cell models which use the unary subtract within its math. The SEDML validation encounters the use of unary subtract operator and raises a validation failure (a false-negative result).

Does this PR introduce any additional changes?
No.

How have you tested this PR?
added a test in test_sedml_math.py which exercises this operator.

@jcschaff jcschaff added bug Something isn't working SED-ML labels May 19, 2023
@jcschaff jcschaff self-assigned this May 19, 2023
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ac14afd) 95.79% compared to head (7abf57a) 95.79%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #139   +/-   ##
=======================================
  Coverage   95.79%   95.79%           
=======================================
  Files          88       88           
  Lines        9399     9399           
=======================================
  Hits         9004     9004           
  Misses        395      395           
Flag Coverage Δ
unittests 95.79% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
biosimulators_utils/sedml/math.py 100.00% <ø> (ø)
biosimulators_utils/_version.py 100.00% <100.00%> (ø)

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jcschaff
Copy link
Member Author

updated software version to 0.1.178 in _version.py prior to merge so that it can be released and pushed to PyPI.

@jcschaff jcschaff merged commit 8698552 into dev May 19, 2023
@jcschaff jcschaff deleted the usub-in-expressions branch May 19, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SED-ML
Development

Successfully merging this pull request may close these issues.

2 participants