The NASA Prognostic Python Packages is a Python framework focused on defining and building models and algorit for prognostics (computation of remaining useful life) of engineering systems, and provides a set of models and algorithms for select components developed within this framework, suitable for use in prognostic applications.
Describe the bug
calling deep copy on a composite model returns an error
Relevant Requirements
SWS requirements to switch over service to use progpy
To Reproduce
create composite model
deep copy
Expected behavior
copy of composite model created
Traceback
Traceback (most recent call last):
File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 2213, in call
return self.wsgi_app(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 2193, in wsgi_app
response = self.handle_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(*view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cteubert/dev/prog_server/src/prog_server/controllers.py", line 60, in new_session
sessions[session_id] = Session(session_id, model_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cteubert/dev/prog_server/src/prog_server/models/session.py", line 58, in init
self.model = deepcopy(model_class)
^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, rv)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/copy.py", line 273, in _reconstruct
y.setstate(state)
File "/Users/cteubert/dev/progpy/src/progpy/prognostics_model.py", line 157, in setstate
raise TypeError('Must have states attribute')
TypeError: Must have states attribute
Describe the bug calling deep copy on a composite model returns an error
Relevant Requirements SWS requirements to switch over service to use progpy
To Reproduce create composite model deep copy
Expected behavior copy of composite model created
Traceback Traceback (most recent call last): File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 2213, in call return self.wsgi_app(environ, start_response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 2193, in wsgi_app response = self.handle_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 2190, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/cteubert/Library/Python/3.11/lib/python/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(*view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/cteubert/dev/prog_server/src/prog_server/controllers.py", line 60, in new_session sessions[session_id] = Session(session_id, model_name, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/cteubert/dev/prog_server/src/prog_server/models/session.py", line 58, in init self.model = deepcopy(model_class) ^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/copy.py", line 172, in deepcopy y = _reconstruct(x, memo, rv) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/copy.py", line 273, in _reconstruct y.setstate(state) File "/Users/cteubert/dev/progpy/src/progpy/prognostics_model.py", line 157, in setstate raise TypeError('Must have
states
attribute') TypeError: Must havestates
attribute