Skip to content

Add annotations that can be used to verify network integrity. #61

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

daemontus
Copy link
Member

@daemontus daemontus commented Feb 14, 2025

This PR introduces a new mechanism that adds optional network annotations into the .aeon file that can be used to verify network integrity. This is mostly intended to avoid unintended typos during manual network modification.

The mechanism is opt-in (check_declarations:true must be present in the network file), but all future versions of lib-param-bn will add this annotation by default. So any previously created networks will ignore this mechanism, and any newly created networks will have this data available if not explicitly deleted.

A variable is considered declared if it appears in the variable annotation string (e.g. #! variable: X declares variable X), or if there are any data keys present for it (e.g. #! variable: X: gene_name: XY also declares variable X). The same mechanism applies to explicit parameters (using the annotation key function), but here, we mostly expect a data entry arity to be present (e.g. #! function: f: arity: 5), since all functions without arity will be regarded as constants (i.e. arity zero).

This also resolves the long standing issue where variables with no regulations would disappear from the model because they are not representable. Such cases will now recreate the variable from its declaration. (this is the only instance where the presence of a declaration takes precedence over the contents of the model).

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 86.36364% with 9 lines in your changes missing coverage. Please review.

Project coverage is 80.65%. Comparing base (6c5e9cc) to head (adf0043).

Files with missing lines Patch % Lines
...c/_aeon_parser/_from_string_for_boolean_network.rs 82.22% 8 Missing ⚠️
src/_impl_annotations/_impl_annotation.rs 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
+ Coverage   80.58%   80.65%   +0.07%     
==========================================
  Files          72       72              
  Lines        5331     5397      +66     
==========================================
+ Hits         4296     4353      +57     
- Misses       1035     1044       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant