Skip to content

Commit bb1010c

Browse files
authored
Merge pull request #18 from nasa/release/v1.6
release v1.6
2 parents 2e2926f + 2e6bf47 commit bb1010c

File tree

14 files changed

+50
-56
lines changed

14 files changed

+50
-56
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
[![GitHub License](https://img.shields.io/badge/License-NOSA-green)](https://github.com/nasa/prog_server/blob/master/license.pdf)
44
[![GitHub Releases](https://img.shields.io/github/release/nasa/prog_server.svg)](https://github.com/nasa/prog_server/releases)
55

6-
The NASA Prognostics As-A-Service (PaaS) Sandbox is a simplified implementation of a Software Oriented Architecture (SOA) for performing prognostics (estimation of time until events and future system states) of engineering systems. The PaaS Sandbox is a wrapper around the [Prognostics Algorithms Package](https://nasa.github.io/progpy/prog_algs_guide.html) and [Prognostics Models Package](https://nasa.github.io/progpy/prog_models_guide.html), allowing one or more users to access the features of these packages through a REST API. The package is intended to be used as a research tool to prototype and benchmark Prognostics As-A-Service (PaaS) architectures and work on the challenges facing such architectures, including Generality, Communication, Security, Environmental Complexity, Utility, and Trust.
6+
The NASA Prognostics As-A-Service (PaaS) Sandbox is a simplified implementation of a Software Oriented Architecture (SOA) for performing prognostics (estimation of time until events and future system states) of engineering systems. The PaaS Sandbox is a wrapper around the [Prognostics Python Package (ProgPy)](https://nasa.github.io/progpy/), allowing one or more users to access the features of these packages through a REST API. The package is intended to be used as a research tool to prototype and benchmark Prognostics As-A-Service (PaaS) architectures and work on the challenges facing such architectures, including Generality, Communication, Security, Environmental Complexity, Utility, and Trust.
77

8-
This is designed to be used with the [Prognostics Algorithms Package](https://nasa.github.io/progpy/prog_algs_guide.html) and [Prognostics Models Package](https://nasa.github.io/progpy/prog_models_guide.html).
8+
This is designed to be used with the [Prognostics Python Package (ProgPy)](https://nasa.github.io/progpy/).
99

1010
## Installation
1111
`pip install prog_server`
@@ -17,19 +17,19 @@ See documentation [here](https://nasa.github.io/progpy/prog_server_guide.html)
1717
Use the following to cite this repository:
1818

1919
```
20-
@misc{2023_nasa_prog_models,
20+
@misc{2023_nasa_prog_server,
2121
author = {Christopher Teubert and Jason Watkins and Katelyn Jarvis},
2222
title = {Prognostics As-A-Service (PaaS) Sandbox},
23-
month = May,
23+
month = October,
2424
year = 2023,
25-
version = {1.5},
25+
version = {1.6},
2626
url = {https://github.com/nasa/prog_server}
2727
}
2828
```
2929

3030
The corresponding reference should look like this:
3131

32-
C. Teubert, J. Watkins, K. Jarvis, Prognostics As-A-Service (PaaS) Sandbox, v1.5, May 2023. URL https://github.com/nasa/prog_server.
32+
C. Teubert, J. Watkins, K. Jarvis, Prognostics As-A-Service (PaaS) Sandbox, v1.6, Oct 2023. URL https://github.com/nasa/prog_server.
3333

3434
## Notices
3535
Copyright © 2021 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.

requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name='prog_server',
14-
version='1.5.0-pre',
14+
version='1.6.0-pre',
1515
description='The NASA Prognostics As-A-Service (PaaS) Sandbox (a.k.a. prog_server) is a simplified Software Oriented Architecture (SOA) for performing prognostics of engineering systems. The PaaS Sandbox is a wrapper around the Prognostics Algorithms and Models Packages, allowing 1+ users to access these packages features through a REST API. The package is intended to be used as a research tool to prototype and benchmark Prognostics As-A-Service (PaaS) architectures and work on the challenges facing such architectures',
1616
long_description=long_description,
1717
long_description_content_type='text/markdown',
@@ -40,7 +40,7 @@
4040
packages=find_packages(where='src'),
4141
python_requires='>=3.7, <3.12',
4242
install_requires=[
43-
'prog_algs',
43+
'progpy',
4444
'requests',
4545
'urllib3',
4646
'flask'

specs/swagger.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
openapi: 3.0.2
33
info:
44
title: Prognostics As A Service (PaaS) Sandbox (prog_server)
5-
description: The PaaS Sandbox (a.k.a., prog_server) exposes a REST API that enables prognostics using the NASA PCoE prog_models and prog_algs packages
5+
description: The PaaS Sandbox (a.k.a., prog_server) exposes a REST API that enables prognostics using the NASA PCoE progpy and progpy packages
66
contact:
77
name: Chris Teubert
88
@@ -313,7 +313,7 @@ paths:
313313
schema:
314314
oneOf:
315315
- type: object
316-
description: bytestream of the pickled [prog_models.PrognosticsModel](https://nasa.github.io/progpy/api_ref/prog_models/PrognosticModel.html) object
316+
description: bytestream of the pickled [progpy.PrognosticsModel](https://nasa.github.io/progpy/api_ref/progpy/PrognosticModel.html) object
317317
- type: object
318318
description: JSON representing configuration of model
319319
example:
@@ -398,27 +398,27 @@ components:
398398
"cov": [[0.15, 0.003], [-0.025, 0.27]]
399399
}
400400
- type: object
401-
description: bytestream of the pickled [prog_models.uncertain_data.UncertainData](https://nasa.github.io/progpy/api_ref/prog_algs/UncertainData.html) object
401+
description: bytestream of the pickled [progpy.uncertain_data.UncertainData](https://nasa.github.io/progpy/api_ref/progpy/UncertainData.html) object
402402
SessionConfiguration:
403403
type: object
404404
required:
405405
- model
406406
properties:
407407
model:
408408
type: string
409-
description: Name of the model (from prog_models.models) to use for the session.
409+
description: Name of the model (from progpy.models) to use for the session.
410410
model_cfg:
411411
type: object
412-
description: Configuration JSON for the model. Configuration parameters are specific to the model and can be found in the [prog_models.models documentation](https://nasa.github.io/progpy/api_ref/prog_models/IncludedModels.html).
412+
description: Configuration JSON for the model. Configuration parameters are specific to the model and can be found in the [progpy.models documentation](https://nasa.github.io/progpy/api_ref/progpy/IncludedModels.html).
413413
state_est:
414414
type: string
415-
description: Name of the state estimator (from prog_algs.state_estimators) to use for the session.
415+
description: Name of the state estimator (from progpy.state_estimators) to use for the session.
416416
state_est_cfg:
417417
type: object
418418
description: Configuration JSON for the state estimator. Configuration parameters are specific to the state estimator.
419419
pred:
420420
type: string
421-
description: Name of the predictor (from prog_algs.predictors) to use for the session.
421+
description: Name of the predictor (from progpy.predictors) to use for the session.
422422
pred_cfg:
423423
type: object
424424
description: Configuration JSON for the predictor. Configuration parameters are specific to the predictor.
@@ -475,10 +475,10 @@ components:
475475
properties:
476476
type:
477477
type: string
478-
description: Name of the model (from prog_models.models) to use for the session.
478+
description: Name of the model (from progpy.models) to use for the session.
479479
cfg:
480480
type: object
481-
description: Configuration JSON for the model. Configuration parameters are specific to the model and can be found in the [prog_models.models documentation](https://nasa.github.io/progpy/api_ref/prog_models/IncludedModels.html).
481+
description: Configuration JSON for the model. Configuration parameters are specific to the model and can be found in the [progpy.models documentation](https://nasa.github.io/progpy/api_ref/progpy/IncludedModels.html).
482482

483483
Sessions:
484484
type: array

src/prog_client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright © 2021 United States Government as represented by the Administrator of the
22
# National Aeronautics and Space Administration. All Rights Reserved.
33

4-
from .session import Session
5-
__version__ = '1.5.0-pre'
4+
from prog_client.session import Session
5+
__version__ = '1.6.0-pre'

src/prog_client/session.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
import requests, json
55
import urllib3
66
import pickle
7-
from prog_algs.uncertain_data import UncertainData
8-
import prog_models
7+
from progpy.uncertain_data import UncertainData
8+
from progpy.utils import containers
99

1010
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
1111

1212

1313
class Session:
1414
"""
15-
Create a new Session in `prog_server`.
15+
Create a new Session in `prog_server`
1616
1717
Args:
1818
model (str): The model to use for this session (e.g., batt)
19-
host (str, optional): Host address for PaaS Service. Defaults to '127.0.0.1'.
19+
host (str, optional): Host address for PaaS Service. Defaults to '127.0.0.1'
2020
port (int, optional): Port for PaaS Service. Defaults to 5000.
2121
model_cfg (dict, optional): Configuration for ProgModel.
2222
x0 (dict, optional): Initial state for ProgModel.
2323
load_est (str, optional): Load estimator to use.
2424
load_est_cfg (dict, optional): Configuration for load estimator.
25-
state_est (str, optional): State Estimator to use (e.g., ParticleFilter). Class name for state estimator in `prog_algs.state_estimators`
25+
state_est (str, optional): State Estimator to use (e.g., ParticleFilter). Class name for state estimator in `progpy.state_estimators`
2626
state_est_cfg (dict, optional): Configuration for state estimator.
27-
pred (str, optional): Prediction algorithm to use (e.g., MonteCarlo). Class name for prediction algorithm in `prog_algs.predictors`
27+
pred (str, optional): Prediction algorithm to use (e.g., MonteCarlo). Class name for prediction algorithm in `progpy.predictors`
2828
pred_cfg (dict, optional): Configuration for prediction algorithm.
2929
3030
Use:
@@ -103,7 +103,7 @@ def set_state(self, x):
103103
if isinstance(x, UncertainData):
104104
x = pickle.dumps(x)
105105
input_format = 'uncertain_data'
106-
elif isinstance(x, prog_models.utils.containers.DictLikeMatrixWrapper):
106+
elif isinstance(x, containers.DictLikeMatrixWrapper):
107107
x = pickle.dumps(x)
108108
input_format = 'state_container'
109109
elif isinstance(x, dict):

src/prog_server/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# National Aeronautics and Space Administration. All Rights Reserved.
33

44
from .models.prog_server import server
5-
6-
__version__ = '1.5.0-pre'
5+
__version__ = '1.6.0-pre'
76

87
def run(**kwargs):
98
"""

src/prog_server/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright © 2021 United States Government as represented by the Administrator of the
22
# National Aeronautics and Space Administration. All Rights Reserved.
33

4-
from .controllers import *
4+
from prog_server.controllers import *
55
from flask import Flask
66

77
app = Flask("prog_server")

src/prog_server/controllers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright © 2021 United States Government as represented by the Administrator of the
22
# National Aeronautics and Space Administration. All Rights Reserved.
33

4-
from .models.session import Session
5-
from .models.load_ests import update_moving_avg
6-
from prog_models.sim_result import SimResult, LazySimResult
7-
from prog_algs.uncertain_data import UnweightedSamples
8-
from prog_algs.predictors import Prediction, UnweightedSamplesPrediction
4+
from prog_server.models.session import Session
5+
from prog_server.models.load_ests import update_moving_avg
6+
from progpy.sim_result import SimResult, LazySimResult
7+
from progpy.uncertain_data import UnweightedSamples
8+
from progpy.predictors import Prediction, UnweightedSamplesPrediction
99
from flask import request, abort, jsonify
1010
from flask import current_app as app
1111
import json

src/prog_server/models/load_ests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Copyright © 2021 United States Government as represented by the Administrator of the
22
# National Aeronautics and Space Administration. All Rights Reserved.
33

4-
from statistics import mean
5-
from numpy.random import normal
64
from flask import abort
75
from functools import partial
6+
from numpy.random import normal
7+
from statistics import mean
88

9-
def Variable(t, x = None, session = None, cfg = None):
9+
def Variable(t, x=None, session=None, cfg=None):
1010
"""Variable (i.e. piecewise) load estimator. The piecewise load function is defined in the load_est_cfg as ordered dictionary starting_time: load.
1111
1212
cfg: ordered dictionary starting_time: load. First key should always be 0
@@ -19,15 +19,15 @@ def Variable(t, x = None, session = None, cfg = None):
1919
return cfg[time]
2020
return cfg[keys[-1]]
2121

22-
def Const(t, x = None, session = None, cfg = None):
22+
def Const(t, x=None, session=None, cfg=None):
2323
"""Constant load estimator. Load is assumed to be constant over time.
2424
2525
cfg: dictionary with one key (load) where value is the constant load (dict)
2626
e.g., {'load': {'u1': 0.1}}
2727
"""
2828
return cfg['load']
2929

30-
def MovingAverage(t, x=None, session = None, cfg = None):
30+
def MovingAverage(t, x=None, session=None, cfg=None):
3131
"""Moving average load estimator. Load is estimated as the mean of the last `window_size` samples. Noise can be added using the following optional configuration parameters:
3232
3333
* base_std: standard deviation of noise
@@ -40,7 +40,7 @@ def MovingAverage(t, x=None, session = None, cfg = None):
4040
load = {key : mean(session.moving_avg_loads[key]) for key in session.model.inputs}
4141
return {key : normal(load[key], std) for key in load.keys()}
4242

43-
def update_moving_avg(u, session = None, cfg = {}):
43+
def update_moving_avg(u, session=None, cfg={}):
4444
for key in session.model.inputs:
4545
session.moving_avg_loads[key].append(u[key])
4646
if len(session.moving_avg_loads[key]) > cfg.get('window_size', 10):
@@ -51,5 +51,5 @@ def build_load_est(name, cfg, session):
5151
abort(400, f"{name} is not a valid load estimation method")
5252
load_est_fcn = globals()[name]
5353
return partial(load_est_fcn,
54-
cfg = cfg,
55-
session = session)
54+
cfg=cfg,
55+
session=session)

0 commit comments

Comments
 (0)