Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Classes for managing collections of variable parameters #38

Merged
merged 11 commits into from
Oct 15, 2021

Conversation

ConorMacBride
Copy link
Owner

@ConorMacBride ConorMacBride commented Oct 1, 2021

Adding classes to help with managing the default parameters of the model classes. The goal is to have a class that can hold arbitrary equations or unevaluated expressions, and evaluate them later when the parameter has been defined a value. There will also be a class that can hold multiple unevaluated expressions. For example,

a = Parameter('x') + 1
a.value = 10
assert a == 11
a = Parameters([Parameter('x') + 1, Parameter('x') + 2])
a.update_parameter('x', 10)
assert a == [11, 12]

Todo

  • Test matching values enforced
  • Test Parameter repr
  • Test Parameter + Parameter gets evaluated

Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
@ConorMacBride ConorMacBride marked this pull request as ready for review October 3, 2021 18:47
@codecov
Copy link

codecov bot commented Oct 14, 2021

Codecov Report

Merging #38 (1277a37) into main (12bb041) will increase coverage by 0.48%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   94.44%   94.92%   +0.48%     
==========================================
  Files          17       18       +1     
  Lines        1224     1341     +117     
==========================================
+ Hits         1156     1273     +117     
  Misses         68       68              
Impacted Files Coverage Δ
src/mcalf/utils/collections.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12bb041...1277a37. Read the comment docs.

Signed-off-by: Conor MacBride <conor@macbride.me>
@ConorMacBride ConorMacBride merged commit b84168b into main Oct 15, 2021
@ConorMacBride ConorMacBride deleted the collections branch November 26, 2021 10:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant