Skip to content

Commit

Permalink
Merge pull request #283 from nasa/release/v1.3
Browse files Browse the repository at this point in the history
Release v1.3
  • Loading branch information
teubert authored May 13, 2022
2 parents 6ae410a + 906244d commit a523e45
Show file tree
Hide file tree
Showing 139 changed files with 10,314 additions and 2,689 deletions.
66 changes: 29 additions & 37 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,11 @@ on:
- prog_models

jobs:
analysis:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Lint with flake8
run: |
python -m pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 src/prog_models --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 src/prog_models --count --benchmark --exit-zero --show-source --max-complexity=10 --max-line-length=127 --statistics --tee --output-file=lint_results_${{ matrix.python-version }}.txt
- name: Upload Lint Results
uses: actions/upload-artifact@v2
with:
name: lint_results_${{matrix.python-version}}
path: lint_results_${{matrix.python-version}}.txt
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: 'python'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -59,13 +25,16 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install notebook
python -m pip install testbook
python -m pip install requests
- name: Run tests
run: python -m tests
test_prog_algs_released:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -76,6 +45,9 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install notebook
python -m pip install testbook
python -m pip install requests
- name: Clone prog_algs
uses: actions/checkout@v2
with:
Expand All @@ -93,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -104,6 +76,9 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e .
pip install notebook
pip install testbook
pip install requests
- name: Clone prog_algs
uses: actions/checkout@v2
with:
Expand All @@ -117,6 +92,20 @@ jobs:
run: |
cd prog_algs
python -m tests
copyright:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run copyright check
run: |
python scripts/test_copyright.py
coverage:
runs-on: ubuntu-latest
strategy:
Expand All @@ -133,6 +122,9 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -e .
pip install coverage
pip install notebook
pip install testbook
pip install requests
- name: Run coverage
run: |
coverage run -m tests
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- 'release/**'
- 'master'

jobs:
analysis:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Lint with flake8
run: |
python -m pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 src/prog_models --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 src/prog_models --count --benchmark --exit-zero --show-source --max-complexity=10 --max-line-length=127 --statistics --tee --output-file=lint_results_${{ matrix.python-version }}.txt
- name: Upload Lint Results
uses: actions/upload-artifact@v2
with:
name: lint_results_${{matrix.python-version}}
path: lint_results_${{matrix.python-version}}.txt
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: 'python'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ cython_debug/
ex.pickle

.vscode/
.DS_Store
model_test.pkl

battery123.cfg

dataset_1.pkl
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ Use the following to cite this repository:

```
@misc{2021_nasa_prog_models,
author = {Christopher Teubert and Matteo Corbetta and Chetan Kulkarni and Matthew Daigle},
author = {Christopher Teubert and Matteo Corbetta and Chetan Kulkarni and Katelyn Jarvis and Matthew Daigle},
title = {Prognostics Models Python Package},
month = Dec,
year = 2021,
version = {1.2.2},
month = May,
year = 2022,
version = {1.3},
url = {https://github.com/nasa/prog_models}
}
```

The corresponding reference should look like this:

C. Teubert, M. Corbetta, C. Kulkarni, and M. Daigle, Prognostics Models Python Package, v1.2.2, Dec. 2021. URL https://github.com/nasa/prog_models.
C. Teubert, C. Kulkarni, M. Corbetta, K. Jarvis, M. Daigle, Prognostics Model Python Package, v1.3, May 2022. URL https://github.com/nasa/prog_models.

## Acknowledgements
The structure and algorithms of this package are strongly inspired by the [MATLAB Prognostics Model Library](https://github.com/nasa/PrognosticsModelLibrary). We would like to recognize Matthew Daigle 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_models
Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 163b495075cd81ec01dc49e97b9c341c
config: 663675407ca8eacfb0c3279f576cc0ca
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added docs/.doctrees/datasets.doctree
Binary file not shown.
Binary file modified docs/.doctrees/dev_guide.doctree
Binary file not shown.
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/.doctrees/getting_started.doctree
Binary file not shown.
Binary file modified docs/.doctrees/index.doctree
Binary file not shown.
Binary file added docs/.doctrees/linear_model.doctree
Binary file not shown.
Binary file modified docs/.doctrees/models.doctree
Binary file not shown.
Binary file modified docs/.doctrees/prognostics_model.doctree
Binary file not shown.
Binary file added docs/.doctrees/release.doctree
Binary file not shown.
Binary file modified docs/.doctrees/simresult.doctree
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def future_loading(t, x=None):
elif event_state["EOD"] < 0.05:
load = -1 # Charge
# Rule for loading at initialization
return {'i': load}
return batt.InputContainer({'i': load})

# Simulate to EOL Threshold
print('\n\n------------------------------------------------')
Expand All @@ -39,7 +39,7 @@ def future_loading(t, x=None):
'threshold_keys': ['InsufficientCapacity'], # Simulate to InsufficientCapacity
'print': True
}
(times, inputs, states, outputs, event_states) = batt.simulate_to_threshold(future_loading, **options)
simulated_results = batt.simulate_to_threshold(future_loading, **options)

# This allows the module to be executed directly
if __name__ == '__main__':
Expand Down
154 changes: 0 additions & 154 deletions docs/_downloads/07c0fc000584a9e07e95b6ff3a52d38f/noise_examples.py

This file was deleted.

Loading

0 comments on commit a523e45

Please sign in to comment.