Skip to content

Commit 663b7f3

Browse files
authored
Merge pull request #98 from wilsonrljr/v0.3.0
V0.3.0
2 parents 9eefabd + d79f969 commit 663b7f3

File tree

122 files changed

+16966
-14374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+16966
-14374
lines changed

.github/workflows/python-package.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10"]
18+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
python -m pip install --upgrade pip
2929
pip install flake8 pytest pytest-cov scikit-learn black isort>=5.0.6
30-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
if [ -f requirements.txt ]; then pip install .["dev"]; fi
3131
- name: Lint with flake8
3232
run: |
3333
# stop the build if there are Python syntax errors or undefined names

CHANGELOG

+39-5
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,71 @@ File for tracking changes in SysIdentPy
55
Changes in SysIdentPy
66
=====================
77

8-
v0.2.2
8+
v0.3.0
99
------
1010

1111
CONTRIBUTORS
1212
~~~~~~~~~~~~
1313

1414
- wilsonrljr
15+
- gamcorn
16+
- Gabo-Tor
1517

1618
CHANGES
1719
~~~~~~~
1820

19-
- The update **v0.2.2** has been released with additional feature, minor API changes and fixes.
21+
- The update **v0.3.0** has been released with additional features, API changes and fixes.
2022

2123
- MAJOR: Estimators support in AOLS
22-
- MAJOR:
23-
- Refactored base class for model structure selection.
24+
- Now you can use any SysIdentPy estimator in AOLS model structure selection.
25+
26+
- API Change:
27+
- Refactored base class for model structure selection. A refactored base class for model structure selection has been introduced in SysIdentPy. This update aims to enhance the system identification process by preparing the package for new features that are currently in development, like multiobjective parameter estimation, new basis functions and more.
28+
29+
Several methods within the base class have undergone significant restructuring to improve their functionality and optimize their performance. This reorganization will facilitate the incorporation of advanced model selection techniques in the future, which will enable users to obtain dynamic models with robust dynamic and static performance.
2430
- Avoid unnecessary inheritance in every MSS method and improve the readability with better structured classes.
2531
- Rewritten methods to avoid code duplication.
2632
- Improve overall code readability by rewriting if/elif/else clauses.
2733

34+
- Breaking Change: `X_train` and `y_train` were replaced respectively by `X` and `y` in `fit` method in MetaMSS model structure selection algorithm. `X_test` and `y_test` were replaced by `X` and `y` in `predict` method in MetaMSS.
35+
36+
- API Change: Added BaseBasisFunction class, an abstract base class for implementing basis functions.
37+
38+
- Enhancement: Added support for python 3.11.
39+
40+
- Future Deprecation Warning: The user will have to define the estimator and pass it to every model structure selection algorithm instead of using a string to define the Estimator. Currently the estimator is defined like "estimator='least_squares'". In version 0.4.0 the definition will be like "estimator=LeastSquares()"
41+
42+
- FIX: Issue #96. Fix issue with numpy 1.24.* version. Thanks for the contribution @gamcorn.
43+
44+
- FIX: Issue #91. Fix r2_score metric issue with 2 dimensional arrays.
45+
46+
- FIX: Issue #90.
47+
48+
- FIX: Issue #88 .Fix one step ahead prediction error in SimulateNARMAX class (thanks for pointing out, Lalith).
49+
2850
- FIX: Fix error in selecting the correct regressors in AOLS.
29-
- FIX: Fix one step ahead prediction error in SimulateNARMAX class (thanks Lalith).
51+
3052
- Fix: Fix n step ahead prediction method not returning all values of the defined steps-ahead value when passing only the initial condition.
53+
3154
- FIX: Fix Visible Deprecation Warning raised in get_max_lag method.
55+
3256
- FIX: Fix deprecation warning in Extended Least Squares Example
57+
3358
- DATASET: Added air passengers dataset to SysIdentPy repository.
59+
3460
- DATASET: Added San Francisco Hospital Load dataset to SysIdentPy repository.
61+
3562
- DATASET: Added San Francisco PV GHI dataset to SysIdentPy repository.
63+
3664
- DOC: Improved documentation in Setting Specif Lags page. Now we bring an example of how to set specific lags for MISO models.
65+
3766
- DOC: Minor additions and grammar fixes.
3867

68+
- DOC: Improve image visualization using mkdocs-glightbox.
69+
70+
- Update dev packages versions
71+
72+
3973
v0.2.1
4074
------
4175

CONTRIBUTING.md

+236
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
---
2+
template: overrides/main.html
3+
title: Contribute
4+
---
5+
6+
# Contributing
7+
8+
SysIdentPy is intended to be a community project, hence all contributions are welcome! There exist many possible use cases in System Identification field and we can not test all scenarios without your help! If you find any bugs or have suggestions, please report them on [issue tracker] on GitHub.
9+
10+
>We welcome new contributors of all experience levels. The SysIdentPy community goals are to be helpful, welcoming, and effective.
11+
12+
[issue tracker]: https://github.com/wilsonrljr/sysidentpy/issues
13+
14+
## Help others with issues in GitHub
15+
16+
You can see <a href="https://github.com/wilsonrljr/sysidentpy/issues" class="external-link" target="_blank">existing issues</a> and try and help others, most of the times they are questions that you might already know the answer for.
17+
18+
## Watch the GitHub repository
19+
20+
You can [watch] SysIdentPy in GitHub (clicking the "watch" button at the top right):
21+
[watch]: https://github.com/wilsonrljr/sysidentpy
22+
23+
If you select "Watching" instead of "Releases only" you will receive notifications when someone creates a new issue.
24+
25+
Then you can try and help them solve those issues.
26+
27+
## Documentation
28+
29+
Documentation is as important as the library itself. English is not the primary language of the main authors, so if you find any typo or anything wrong do not hesitate to point out to us.
30+
31+
## Create a Pull Request
32+
33+
You can [contribute](contribute.md){.internal-link target=_blank} to the source code with Pull Requests, for example:
34+
35+
* To fix a typo you found on the documentation.
36+
* To share an article, video, or podcast you created or found about SysIdentPy.
37+
* To propose new documentation sections.
38+
* To fix an existing issue/bug.
39+
* To add a new feature.
40+
41+
## Development environment
42+
43+
These are some basic steps to help us with code:
44+
45+
- [x] Install and Setup Git on your computer.
46+
- [x] [Fork] SysIdentPy.
47+
- [x] [Clone] the fork on your local machine.
48+
- [x] Create a new branch.
49+
- [x] Make changes following the coding style of the project (or suggesting improvements).
50+
- [x] Run the tests.
51+
- [x] Write and/or adapt existing test if needed.
52+
- [x] Add documentation if needed.
53+
- [x] Commit.
54+
- [x] [Push] to your fork.
55+
- [x] Open a [pull_request].
56+
57+
[Fork]: https://help.github.com/articles/fork-a-repo/
58+
[Clone]: https://help.github.com/articles/cloning-a-repository/
59+
[Push]: https://help.github.com/articles/pushing-to-a-remote/
60+
[pull_request]: https://help.github.com/articles/creating-a-pull-request/
61+
62+
63+
### Environment
64+
65+
Clone the repository using
66+
67+
```console
68+
git clone https://github.com/wilsonrljr/sysidentpy.git
69+
```
70+
71+
If you already cloned the repository and you know that you need to deep dive in the code, here are some guidelines to set up your environment.
72+
73+
#### Virtual environment with `venv`
74+
75+
You can create a virtual environment in a directory using Python's `venv` module or Conda:
76+
77+
=== "venv"
78+
79+
```console
80+
$ python -m venv env
81+
```
82+
83+
=== "conda"
84+
85+
```console
86+
conda create -n env
87+
```
88+
89+
90+
That will create a directory `./env/` with the Python binaries and then you will be able to install packages for that isolated environment.
91+
92+
#### Activate the environment
93+
94+
If you created the environment using Python's `venv` module, activate it with:
95+
96+
=== "Linux, macOS"
97+
98+
```console
99+
source ./env/bin/activate
100+
```
101+
102+
=== "Windows PowerShell"
103+
104+
```console
105+
.\env\Scripts\Activate.ps1
106+
```
107+
108+
=== "Windows Bash"
109+
110+
Or if you use Bash for Windows (e.g. <a href="https://gitforwindows.org/" class="external-link" target="_blank">Git Bash</a>):
111+
112+
```console
113+
source ./env/Scripts/activate
114+
```
115+
116+
If you created the environment using Conda, activate it with:
117+
118+
=== "Conda Bash"
119+
120+
Or if you use Bash for Windows (e.g. <a href="https://gitforwindows.org/" class="external-link" target="_blank">Git Bash</a>):
121+
122+
```console
123+
conda activate env
124+
```
125+
126+
To check it worked, use:
127+
128+
=== "Linux, macOS, Windows Bash"
129+
130+
```console
131+
$ which pip
132+
133+
some/directory/sysidentpy/env/Scripts/pip
134+
```
135+
136+
=== "Windows PowerShell"
137+
138+
```console
139+
$ Get-Command pip
140+
141+
some/directory/sysidentpy/env/Scripts/pip
142+
```
143+
144+
=== "Windows Bash"
145+
146+
```console
147+
$ where pip
148+
149+
some/directory/sysidentpy/env/Scripts/pip
150+
```
151+
152+
If it shows the `pip` binary at `env/bin/pip` then it worked.
153+
154+
155+
156+
!!! tip
157+
Every time you install a new package with `pip` under that environment, activate the environment again.
158+
159+
160+
161+
!!! note
162+
We use the `pytest` package for testing. The test functions are located in tests subdirectories at each folder inside SysIdentPy, which check the validity of the algorithms.
163+
164+
#### Dependencies
165+
166+
Install SysIdentPy with the `dev` and `docs` option to get all the necessary dependencies to run the tests
167+
168+
=== "Dev and Docs dependencies"
169+
170+
``` sh
171+
pip install "sysidentpy[dev, docs]"
172+
```
173+
174+
## Docs
175+
176+
First, make sure you set up your environment as described above, that will install all the requirements.
177+
178+
The documentation uses <a href="https://www.mkdocs.org/" class="external-link" target="_blank">MkDocs</a> and <a href="https://squidfunk.github.io/mkdocs-material/" class="external-link" target="_blank">Material for MKDocs</a>.
179+
180+
All the documentation is in Markdown format in the directory `./docs/`.
181+
182+
### Check the changes
183+
184+
During local development, you can serve the website locally and checks for any changes. This helps making sure that:
185+
186+
* All of your modifications were applied.
187+
* The unmodified files are displaying as expected.
188+
189+
190+
```console
191+
$ mkdocs serve
192+
193+
INFO - [13:25:00] Browser connected: http://127.0.0.1:8000
194+
```
195+
196+
It will serve the documentation on `http://127.0.0.1:8008`.
197+
198+
That way, you can keep editing the source files and see the changes live.
199+
200+
!!! warning
201+
If any modification break the build, you have to serve the website again. Always check your `console` to make sure you are serving the website.
202+
203+
204+
## Run tests locally
205+
206+
Its always good to check if your implementations/modifications does not break any other part of the package. You can run the SysIdentPy tests locally using `pytest` in the respective folder to perform all the tests of the corresponding sub-packages.
207+
208+
#### Example of how to run the tests:
209+
210+
Open a terminal emulator of your choice and go to a subdirectory, e.g,
211+
212+
\sysidentpy\metrics\
213+
214+
Just type `pytest` in the terminal emulator
215+
216+
```console
217+
pytest
218+
```
219+
220+
and you get a result like:
221+
222+
```console
223+
========== test session starts ==========
224+
225+
platform linux -- Python 3.7.6, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
226+
227+
rootdir: ~/sysidentpy
228+
229+
plugins: cov-2.8.1
230+
231+
collected 12 items
232+
233+
tests/test_regression.py ............ [100%]
234+
235+
========== 12 passed in 2.45s ==================
236+
```

CONTRIBUTING.rst

-37
This file was deleted.

0 commit comments

Comments
 (0)