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

Tests/improving linear tests #499

Closed aqitya closed 1 year ago

aqitya commented 1 year ago

Improved Linear Tests by making testing more robust via setter and getter methods and providing greater range of testing for given parameters.

Implemented eq for linear models.

Added a copy and serialize functions in linear tests that are not complete, but is included because it is code that will be used but later revamped.

Furthermore, created a eq function in parameters.py that is being tested in test_base_models. The tests need to test other types of datatypes.

Moved composite model tests to test_composite.py file. (No changes were made to the tests)

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.5318868000000001
import thrown object 0.3740053
model initialization 0.0002674000000000287
set noise 3.4999999999341114e-06
simulate 0.00043519999999996895
simulate with saving 0.0010434000000000276
simulate with saving, dt 0.002362200000000092
simulate with printing results, dt 0.0028950999999999283
Plot results 0.018745800000000035
Metrics 0.00035789999999991107
Surrogate Model Generation 1.7851701
surrogate sim 0.0012858000000002257
surrogate sim, dt 0.0029055000000002273
To: Test Time (s)
import main 0.7408415
import thrown object 0.3919224
model initialization 0.00027250000000011987
set noise 3.5000000000451337e-06
simulate 0.00042429999999993306
simulate with saving 0.0010308000000001094
simulate with saving, dt 0.002349999999999852
simulate with printing results, dt 0.0029049999999999354
Plot results 0.02033930000000006
Metrics 0.0003505999999999787
Surrogate Model Generation 1.8670221000000002
surrogate sim 0.001303799999999633
surrogate sim, dt 0.002923299999999962
github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.6881115
import thrown object 0.451697
model initialization 0.00028660000000013675
set noise 3.6999999999398625e-06
simulate 0.0004668999999999368
simulate with saving 0.0010077000000001668
simulate with saving, dt 0.002695000000000114
simulate with printing results, dt 0.003383000000000136
Plot results 0.021091399999999982
Metrics 0.00038469999999990456
Surrogate Model Generation 2.0428281999999998
surrogate sim 0.001539799999999758
surrogate sim, dt 0.0033234000000001984

To:

Test Time (s)
import main 0.8949853
import thrown object 0.5204833
model initialization 0.0003094999999999626
set noise 3.399999999986747e-06
simulate 0.0005075999999999414
simulate with saving 0.001178999999999819
simulate with saving, dt 0.0027456000000001257
simulate with printing results, dt 0.0026863999999999777
Plot results 0.025669900000000023
Metrics 0.00035279999999993095
Surrogate Model Generation 2.2146983000000002
surrogate sim 0.0010851999999998974
surrogate sim, dt 0.0028980999999999035
aqitya commented 1 year ago

I jsut ran all the tests once more, they all passed (other than the benchmarking one), but I am rerunning without some additional files that were cluttering the repo (the previous test.txt file that Chris told me to remove)

aqitya commented 1 year ago

All the changes from dev have just been moved onto this branch^