nasa / prog_models

The NASA Prognostic Model Package is a Python framework focused on defining and building models for prognostics (computation of remaining useful life) of engineering systems, and provides a set of prognostics models for select components developed within this framework, suitable for use in prognostics applications for these components.
123 stars 50 forks source link

487 Composite: pm connections #543

Closed teubert closed 1 year ago

teubert commented 1 year ago

Extend composite to allow connections from Performance Metrics. This allows the input of one model to be connected to the performance metric from another.

https://github.com/nasa/prog_models/issues/487

github-actions[bot] commented 1 year ago

Thank you for opening this PR. Each PR into dev requires a code review. For the code review, look at the following:

github-actions[bot] commented 1 year ago
Benchmarking Results From: Test Time (s)
import main 0.12619980000000008
import thrown object 0.5071087999999999
model initialization 0.11798229999999998
set noise 0.6706577
simulate 0.2967439999999999
simulate with saving 0.9053400999999996
simulate with saving, dt 1.0166773999999994
simulate with printing results, dt 1.2433458999999996
Plot results 13.952930499999999
Metrics 0.04107050000000001
Surrogate Model Generation 3.1519531
surrogate sim 0.9932063999999983
surrogate sim, dt 2.8791662000000002
To: Test Time (s)
import main 0.12579189999999985
import thrown object 0.5163523999999999
model initialization 0.11493219999999993
set noise 0.6689179999999997
simulate 0.2975053999999999
simulate with saving 0.9091996
simulate with saving, dt 1.0192207
simulate with printing results, dt 1.2388724999999994
Plot results 13.9322032
Metrics 0.04043319999999895
Surrogate Model Generation 3.229518800000001
surrogate sim 0.9897982000000027
surrogate sim, dt 2.878303599999999
aqitya commented 1 year ago

Line 199 in composite_model.py reads '# Propogate state', instead of '# Propagate state'.

aqitya commented 1 year ago

Having a second, more complex example may be worthwhile to include to the tests.

Maybe a test where we are passing in different models and where circular connections are prevalent as a 'sanity check'.

aqitya commented 1 year ago

Overall, nice changes!

It was also a good exercise on my end to see CompositeModels in action!

github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.12929970000000002
import thrown object 0.5113297000000001
model initialization 0.12313550000000006
set noise 0.6488028000000001
simulate 0.2956158000000002
simulate with saving 0.9272155
simulate with saving, dt 1.0253885
simulate with printing results, dt 1.2426218999999996
Plot results 14.726319099999998
Metrics 0.037303099999999034
Surrogate Model Generation 3.2437284999999996
surrogate sim 1.0822885999999983
surrogate sim, dt 2.9467736

To:

Test Time (s)
import main 0.13093240000000006
import thrown object 0.5061500000000001
model initialization 0.12075440000000026
set noise 0.6800925000000002
simulate 0.2954622999999996
simulate with saving 0.9309426000000003
simulate with saving, dt 1.0228818000000004
simulate with printing results, dt 1.2594505000000007
Plot results 14.833517099999998
Metrics 0.03539800000000071
Surrogate Model Generation 3.3742625000000004
surrogate sim 1.0930800000000005
surrogate sim, dt 2.955954900000002
codecov-commenter commented 1 year ago

Codecov Report

Merging #543 (6debc7d) into dev (580fbd4) will increase coverage by 0.09%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #543      +/-   ##
==========================================
+ Coverage   80.22%   80.31%   +0.09%     
==========================================
  Files          30       30              
  Lines        2432     2444      +12     
==========================================
+ Hits         1951     1963      +12     
  Misses        481      481              
Impacted Files Coverage Δ
src/prog_models/composite_model.py 89.93% <100.00%> (+0.82%) :arrow_up: