From 38dab816c675b49b7878d12eb4f4d832910ab7eb Mon Sep 17 00:00:00 2001 From: Aditya Tummala Date: Fri, 23 Jun 2023 03:48:00 -0700 Subject: [PATCH 1/8] Create tests.txt --- tests.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests.txt diff --git a/tests.txt b/tests.txt new file mode 100644 index 00000000..03cda11d --- /dev/null +++ b/tests.txt @@ -0,0 +1,2 @@ +ipython>=8.10.0 +ipykernel>=6.21.2 \ No newline at end of file From 51def8f1bbdb5ea4667dd8e453bb45ea7b789548 Mon Sep 17 00:00:00 2001 From: Aditya Tummala Date: Fri, 23 Jun 2023 13:05:02 -0700 Subject: [PATCH 2/8] ? --- my_stuff.txt | 89 +++++++++++++++++++++++++++++++++++++++++++ test_requirements.txt | 4 ++ tests.txt | 2 - 3 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 my_stuff.txt create mode 100644 test_requirements.txt delete mode 100644 tests.txt diff --git a/my_stuff.txt b/my_stuff.txt new file mode 100644 index 00000000..ba744c20 --- /dev/null +++ b/my_stuff.txt @@ -0,0 +1,89 @@ +absl-py==1.4.0 +appnope==0.1.3 +asttokens==2.2.1 +astunparse==1.6.3 +attrs==23.1.0 +backcall==0.2.0 +cachetools==5.3.0 +certifi==2022.12.7 +chaospy==4.3.10 +charset-normalizer==3.0.1 +comm==0.1.3 +contourpy==1.0.7 +cycler==0.11.0 +debugpy==1.6.7 +decorator==5.1.1 +executing==1.2.0 +fastjsonschema==2.17.1 +filterpy==1.4.5 +flatbuffers==23.1.21 +fonttools==4.38.0 +gast==0.4.0 +google-auth==2.16.1 +google-auth-oauthlib==0.4.6 +google-pasta==0.2.0 +grpcio==1.51.3 +h5py==3.8.0 +idna==3.4 +ipykernel==6.23.2 +ipython==8.14.0 +jedi==0.18.2 +jsonschema==4.17.3 +jupyter_client==8.2.0 +jupyter_core==5.3.1 +keras==2.11.0 +kiwisolver==1.4.4 +libclang==15.0.6.1 +Markdown==3.4.1 +MarkupSafe==2.1.2 +matplotlib==3.7.0 +matplotlib-inline==0.1.6 +nbclient==0.8.0 +nbformat==5.9.0 +nest-asyncio==1.5.6 +numpoly==1.2.5 +numpy==1.24.2 +oauthlib==3.2.2 +opt-einsum==3.3.0 +packaging==23.0 +pandas==1.5.3 +parso==0.8.3 +pexpect==4.8.0 +pickleshare==0.7.5 +Pillow==9.4.0 +platformdirs==3.7.0 +-e git+https://github.com/nasa/prog_algs@38dab816c675b49b7878d12eb4f4d832910ab7eb#egg=prog_algs +-e git+https://github.com/nasa/prog_models@4f6cbc4847acabf85b91b7c40651333c2221c9ee#egg=prog_models +prompt-toolkit==3.0.38 +protobuf==3.19.6 +psutil==5.9.5 +ptyprocess==0.7.0 +pure-eval==0.2.2 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +Pygments==2.15.1 +pyparsing==3.0.9 +pyrsistent==0.19.3 +python-dateutil==2.8.2 +pytz==2022.7.1 +pyzmq==25.1.0 +requests==2.28.2 +requests-oauthlib==1.3.1 +rsa==4.9 +scipy==1.10.1 +six==1.16.0 +stack-data==0.6.2 +tensorboard==2.11.2 +tensorboard-data-server==0.6.1 +tensorboard-plugin-wit==1.8.1 +tensorflow-estimator==2.11.0 +tensorflow-macos==2.11.0 +termcolor==2.2.0 +testbook==0.4.2 +tornado==6.3.2 +traitlets==5.9.0 +typing_extensions==4.5.0 +urllib3==1.26.14 +wcwidth==0.2.6 +Werkzeug==2.2.3 +wrapt==1.15.0 diff --git a/test_requirements.txt b/test_requirements.txt new file mode 100644 index 00000000..e1396156 --- /dev/null +++ b/test_requirements.txt @@ -0,0 +1,4 @@ +ipython>=8.10.0 +ipykernel>=6.21.2 +testbook>=0.4.2 +. \ No newline at end of file diff --git a/tests.txt b/tests.txt deleted file mode 100644 index 03cda11d..00000000 --- a/tests.txt +++ /dev/null @@ -1,2 +0,0 @@ -ipython>=8.10.0 -ipykernel>=6.21.2 \ No newline at end of file From e0536a2063d7db318185d6a006354843c8c8d34a Mon Sep 17 00:00:00 2001 From: Aditya Tummala Date: Fri, 23 Jun 2023 13:11:16 -0700 Subject: [PATCH 3/8] Delete my_stuff.txt --- my_stuff.txt | 89 ---------------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 my_stuff.txt diff --git a/my_stuff.txt b/my_stuff.txt deleted file mode 100644 index ba744c20..00000000 --- a/my_stuff.txt +++ /dev/null @@ -1,89 +0,0 @@ -absl-py==1.4.0 -appnope==0.1.3 -asttokens==2.2.1 -astunparse==1.6.3 -attrs==23.1.0 -backcall==0.2.0 -cachetools==5.3.0 -certifi==2022.12.7 -chaospy==4.3.10 -charset-normalizer==3.0.1 -comm==0.1.3 -contourpy==1.0.7 -cycler==0.11.0 -debugpy==1.6.7 -decorator==5.1.1 -executing==1.2.0 -fastjsonschema==2.17.1 -filterpy==1.4.5 -flatbuffers==23.1.21 -fonttools==4.38.0 -gast==0.4.0 -google-auth==2.16.1 -google-auth-oauthlib==0.4.6 -google-pasta==0.2.0 -grpcio==1.51.3 -h5py==3.8.0 -idna==3.4 -ipykernel==6.23.2 -ipython==8.14.0 -jedi==0.18.2 -jsonschema==4.17.3 -jupyter_client==8.2.0 -jupyter_core==5.3.1 -keras==2.11.0 -kiwisolver==1.4.4 -libclang==15.0.6.1 -Markdown==3.4.1 -MarkupSafe==2.1.2 -matplotlib==3.7.0 -matplotlib-inline==0.1.6 -nbclient==0.8.0 -nbformat==5.9.0 -nest-asyncio==1.5.6 -numpoly==1.2.5 -numpy==1.24.2 -oauthlib==3.2.2 -opt-einsum==3.3.0 -packaging==23.0 -pandas==1.5.3 -parso==0.8.3 -pexpect==4.8.0 -pickleshare==0.7.5 -Pillow==9.4.0 -platformdirs==3.7.0 --e git+https://github.com/nasa/prog_algs@38dab816c675b49b7878d12eb4f4d832910ab7eb#egg=prog_algs --e git+https://github.com/nasa/prog_models@4f6cbc4847acabf85b91b7c40651333c2221c9ee#egg=prog_models -prompt-toolkit==3.0.38 -protobuf==3.19.6 -psutil==5.9.5 -ptyprocess==0.7.0 -pure-eval==0.2.2 -pyasn1==0.4.8 -pyasn1-modules==0.2.8 -Pygments==2.15.1 -pyparsing==3.0.9 -pyrsistent==0.19.3 -python-dateutil==2.8.2 -pytz==2022.7.1 -pyzmq==25.1.0 -requests==2.28.2 -requests-oauthlib==1.3.1 -rsa==4.9 -scipy==1.10.1 -six==1.16.0 -stack-data==0.6.2 -tensorboard==2.11.2 -tensorboard-data-server==0.6.1 -tensorboard-plugin-wit==1.8.1 -tensorflow-estimator==2.11.0 -tensorflow-macos==2.11.0 -termcolor==2.2.0 -testbook==0.4.2 -tornado==6.3.2 -traitlets==5.9.0 -typing_extensions==4.5.0 -urllib3==1.26.14 -wcwidth==0.2.6 -Werkzeug==2.2.3 -wrapt==1.15.0 From c0a14f43d0f76e4dd2cde98367c7c778b8d2fa9a Mon Sep 17 00:00:00 2001 From: Christopher Teubert Date: Wed, 21 Jun 2023 15:20:30 -0700 Subject: [PATCH 4/8] Fix readme --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 27bd254c..598d82c7 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ See documentation [here](https://nasa.github.io/progpy/prog_algs_guide.html) ## Repository Directory Structure `src/prog_algs/` - The prognostics algorithm python package
-`docs/` - Project documentation (see also [github.io](https://nasa.github.io/prog_algs/))
`examples/` - Example Python scripts using prog_algs
`tests/` - Tests for prog_models
`README.md` - The readme (this file)
From c4a537801b3190825fbcd047e35b5019362a12a9 Mon Sep 17 00:00:00 2001 From: Christopher Teubert Date: Fri, 23 Jun 2023 13:52:27 -0700 Subject: [PATCH 5/8] Fix readme --- README.md | 10 +++++----- ...c Algorithm Library NOSA_2021.pdf => license.pdf | Bin tutorial.ipynb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename Python Prognostic Algorithm Library NOSA_2021.pdf => license.pdf (100%) diff --git a/README.md b/README.md index 598d82c7..196c0530 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,11 @@ See documentation [here](https://nasa.github.io/progpy/prog_algs_guide.html) Use the following to cite this repository: ``` -@misc{2022_nasa_prog_algs, +@misc{2023_nasa_prog_algs, author = {Christopher Teubert and Matteo Corbetta and Chetan Kulkarni}, title = {Prognostics Algorithm Python Package}, - month = Dec, - year = 2022, + month = May, + year = 2023, version = {1.5}, url = {https://github.com/nasa/prog\_algs} } @@ -37,11 +37,11 @@ Use the following to cite this repository: The corresponding reference should look like this: -C. Teubert, M. Corbetta, C. Kulkarni, Prognostics Algorithm Python Package, v1.5, Dec 2022. URL https://github.com/nasa/prog_algs. +C. Teubert, M. Corbetta, C. Kulkarni, Prognostics Algorithm Python Package, v1.5, May 2023. URL https://github.com/nasa/prog_algs. Alternatively, if using both prog_models and prog_algs, you can cite the combined package as -C. Teubert, C. Kulkarni, M. Corbetta, K. Jarvis, M. Daigle, ProgPy Prognostics Python Packages, v1.5, December 2022. URL https://nasa.github.io/progpy. +C. Teubert, C. Kulkarni, M. Corbetta, K. Jarvis, M. Daigle, ProgPy Prognostics Python Packages, v1.5, May 2023. URL https://nasa.github.io/progpy. ## Acknowledgements The structure and algorithms of this package are strongly inspired by the [MATLAB Prognostics Algorithm Library](https://github.com/nasa/PrognosticsAlgorithmLibrary) and the [MATLAB Prognostics Metrics Library](https://github.com/nasa/PrognosticsMetricsLibrary). We would like to recognize Matthew Daigle, Shankar Sankararaman and the rest of the team that contributed to the Prognostics Model Library for the contributions their work on the MATLAB library made to the design of prog_algs diff --git a/Python Prognostic Algorithm Library NOSA_2021.pdf b/license.pdf similarity index 100% rename from Python Prognostic Algorithm Library NOSA_2021.pdf rename to license.pdf diff --git a/tutorial.ipynb b/tutorial.ipynb index cb91125b..b9934b17 100644 --- a/tutorial.ipynb +++ b/tutorial.ipynb @@ -54,7 +54,7 @@ "* `prog_algs.uncertain_data.ScalarData` - Data without uncertainty, a single value\n", "* `prog_algs.uncertain_data.UnweightedSamples` - Data represented by a set of unweighted samples. Objects of this class can be treated like a list where samples[n] returns the nth sample (Dict)\n", "\n", - "To begin using `UncertainData`, import the type that best portrays the data. In this simple demonstration, we import the `UnweightedSamples` data type. See for full details on the available `UncertainData` types." + "To begin using `UncertainData`, import the type that best portrays the data. In this simple demonstration, we import the `UnweightedSamples` data type. See for full details on the available `UncertainData` types." ] }, { @@ -192,7 +192,7 @@ "\n", "In `prog_algs` a State Estimator is used to estimate the system state. \n", "\n", - "To start, import the needed packages. Here we will import the `BatteryCircuit` model and the `UnscentedKalmanFilter` state estimator. See for more details on the available state estimators.\n" + "To start, import the needed packages. Here we will import the `BatteryCircuit` model and the `UnscentedKalmanFilter` state estimator. See for more details on the available state estimators.\n" ] }, { From 0fa7f08b61d93a1cbd1c6494c74722864b732c3e Mon Sep 17 00:00:00 2001 From: Aditya Tummala Date: Tue, 27 Jun 2023 12:48:12 -0700 Subject: [PATCH 6/8] dt changes --- src/prog_algs/state_estimators/kalman_filter.py | 8 ++++---- src/prog_algs/state_estimators/particle_filter.py | 6 +++--- src/prog_algs/state_estimators/state_estimator.py | 12 ++++++------ .../state_estimators/unscented_kalman_filter.py | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/prog_algs/state_estimators/kalman_filter.py b/src/prog_algs/state_estimators/kalman_filter.py index 731b4a4d..417ab45c 100644 --- a/src/prog_algs/state_estimators/kalman_filter.py +++ b/src/prog_algs/state_estimators/kalman_filter.py @@ -30,10 +30,10 @@ class KalmanFilter(state_estimator.StateEstimator): alpha (float, optional): KF Scaling parameter. An alpha > 1 turns this into a fading memory filter. t0 (float, optional): - Maximum timestep for prediction in seconds. By default is the difference between new and last t. Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt] - e.g., dt = 1e-2 + Starting time (s) dt (float, optional): - time step (s) + Maximum timestep for prediction in seconds. By default, the timestep dt is the difference between the last and current call of .estimate(). Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt'] + e.g., dt = 1e-2 Q (list[list[float]], optional): Kalman Process Noise Matrix R (list[list[float]], optional): @@ -116,7 +116,7 @@ def estimate(self, t: float, u, z, **kwargs): Keyword Arguments ----------------- dt : float, optional - Maximum timestep for prediction in seconds. By default is the difference between new and last t. Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt] + Maximum timestep for prediction in seconds. By default, the timestep dt is the difference between the last and current call of .estimate(). Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt'] e.g., dt = 1e-2 """ assert t > self.t, "New time must be greater than previous" diff --git a/src/prog_algs/state_estimators/particle_filter.py b/src/prog_algs/state_estimators/particle_filter.py index 9b2c894e..d85ad773 100644 --- a/src/prog_algs/state_estimators/particle_filter.py +++ b/src/prog_algs/state_estimators/particle_filter.py @@ -32,7 +32,7 @@ class ParticleFilter(state_estimator.StateEstimator): t0 (float, optional): Starting time (s) dt (float, optional): - Maximum timestep for prediction in seconds. By default is the difference between new and last t. Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt] + Maximum timestep for prediction in seconds. By default, the timestep dt is the difference between the last and current call of .estimate(). Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt'] e.g., dt = 1e-2 num_particles (int, optional): Number of particles in particle filter @@ -100,7 +100,7 @@ def estimate(self, t : float, u, z, dt = None): Keyword Args ------------ dt : float, optional - Maximum timestep for prediction in seconds. By default is the difference between new and last t. Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt] + Maximum timestep for prediction in seconds. By default, the timestep dt is the difference between the last and current call of .estimate(). Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt'] e.g., dt = 1e-2 Note @@ -141,7 +141,7 @@ def estimate(self, t : float, u, z, dt = None): # Get particle measurements zPredicted = output(self.particles) else: - # Propogate and calculate weights + # Propagate and calculate weights for i in range(num_particles): t_i = self.t # Used to mark time for each particle x = self.model.StateContainer({key: particles[key][i] for key in particles.keys()}) diff --git a/src/prog_algs/state_estimators/state_estimator.py b/src/prog_algs/state_estimators/state_estimator.py index be4f7923..75cac51f 100644 --- a/src/prog_algs/state_estimators/state_estimator.py +++ b/src/prog_algs/state_estimators/state_estimator.py @@ -10,7 +10,7 @@ class StateEstimator(ABC): """ Interface class for state estimators - Abstract base class for creating state estimators that perform state estimation. Subclasses must implement this interface. Equivilant to "Observers" in NASA's Matlab Prognostics Algorithm Library + Abstract base class for creating state estimators that perform state estimation. Subclasses must implement this interface. Equivalent to "Observers" in NASA's Matlab Prognostics Algorithm Library Args: model (PrognosticsModel): @@ -20,14 +20,14 @@ class StateEstimator(ABC): Initial (starting) state, with keys defined by model.states \n e.g., x = ScalarData({'abc': 332.1, 'def': 221.003}) given states = ['abc', 'def'] - Keywork Args: + Keyword Args: t0 (float): Initial time at which prediction begins, e.g., 0 dt (float): - Maximum timestep for prediction in seconds. By default is the difference between new and last t. Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt] + Maximum timestep for prediction in seconds. By default, the timestep dt is the difference between the last and current call of .estimate(). Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt'] e.g., dt = 1e-2 **kwargs: - See state-estimator specific documentation for speicfic keyword arguments. + See state-estimator specific documentation for specific keyword arguments. """ default_parameters = { @@ -91,10 +91,10 @@ def estimate(self, t: float, u, z, **kwargs) -> None: Keyword Args ------------- dt : float, optional - Maximum timestep for prediction in seconds. By default is the difference between new and last t. Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt] + Maximum timestep for prediction in seconds. By default, the timestep dt is the difference between the last and current call of .estimate(). Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt'] e.g., dt = 1e-2 **kwargs: - See state-estimator specific documentation for speicfic keyword arguments. + See state-estimator specific documentation for specific keyword arguments. Note ---- diff --git a/src/prog_algs/state_estimators/unscented_kalman_filter.py b/src/prog_algs/state_estimators/unscented_kalman_filter.py index adcfb6b0..38c34eea 100644 --- a/src/prog_algs/state_estimators/unscented_kalman_filter.py +++ b/src/prog_algs/state_estimators/unscented_kalman_filter.py @@ -33,7 +33,7 @@ class UnscentedKalmanFilter(state_estimator.StateEstimator): t0 (float, optional): Starting time (s) dt (float, optional): - Maximum timestep for prediction in seconds. By default is the difference between new and last t. Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt] + Maximum timestep for prediction in seconds. By default, the timestep dt is the difference between the last and current call of .estimate(). Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt'] e.g., dt = 1e-2 Q (list[list[float]], optional): Process Noise Matrix @@ -113,7 +113,7 @@ def estimate(self, t: float, u, z, **kwargs): Keyword Args ------------ dt : float, optional - Maximum timestep for prediction in seconds. By default is the difference between new and last t. Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt] + Maximum timestep for prediction in seconds. By default, the timestep dt is the difference between the last and current call of .estimate(). Some models are unstable at larger dt. Setting a smaller dt will force the model to take smaller steps; resulting in multiple prediction steps for each estimate step. Default is the parameters['dt'] e.g., dt = 1e-2 """ assert t > self.t, "New time must be greater than previous" From dbd5cb80e8b90f1c67d11ae641d7e615c3e5469b Mon Sep 17 00:00:00 2001 From: Christopher Teubert Date: Tue, 27 Jun 2023 15:09:08 -0700 Subject: [PATCH 7/8] remove import --- .gitignore | 2 ++ setup.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3c50e3f2..688f5636 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,5 @@ cython_debug/ .DS_Store data_test.pkl predictor_test.pkl + +.VSCodeCounter/ diff --git a/setup.py b/setup.py index f23486ad..e0af8ac4 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ from setuptools import setup, find_packages import pathlib -import pkg_resources here = pathlib.Path(__file__).parent.resolve() From 57546c28da18d941c9aef639b6f86543345bb37d Mon Sep 17 00:00:00 2001 From: Christopher Teubert Date: Thu, 29 Jun 2023 08:22:47 -0700 Subject: [PATCH 8/8] Version # --- setup.py | 4 ++-- src/prog_algs/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e0af8ac4..cea3c002 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name = 'prog_algs', - version = '1.5.0.pre', + version = '1.5.0', description = "The NASA Prognostics Algorithm Package is a framework for model-based prognostics (computation of remaining useful life) of engineering systems. It includes algorithms for state estimation and prediction, including uncertainty propagation. The algorithms use prognostic models (see prog_models) to perform estimation and prediction. The package enables rapid development of prognostics solutions for given models of components and systems. Algorithms can be swapped for comparative studies and evaluations", long_description=long_description, long_description_content_type='text/markdown', @@ -42,7 +42,7 @@ 'scipy', 'filterpy', 'matplotlib', - 'prog_models>=1.5.0.pre' + 'prog_models>=1.5.0' ], license = 'NOSA', project_urls={ # Optional diff --git a/src/prog_algs/__init__.py b/src/prog_algs/__init__.py index 293ae246..dd5420db 100644 --- a/src/prog_algs/__init__.py +++ b/src/prog_algs/__init__.py @@ -5,7 +5,7 @@ import warnings -__version__ = '1.5.0.pre' +__version__ = '1.5.0' def run_prog_playback(obs, pred, future_loading, output_measurements, **kwargs): warnings.warn("Depreciated in 1.2.0, will be removed in a future release.", DeprecationWarning)