-
Notifications
You must be signed in to change notification settings - Fork 7
Scripts refactoring and CPD benchmarking docs #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
841ce10
chore: add installation scripts
iraedeus d2b0ea9
chore: add benchmarking guide and sync readme
iraedeus 761a5b0
ci: add workflow for installation for both windows and linux
iraedeus b836e1e
fix: dot in dev script
iraedeus 86fe7ff
fix(docs): images and paths to them
iraedeus e39d870
fix: oneliners and english instead russian
iraedeus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Package Installation | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| linux-installation: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install poetry | ||
|
|
||
| - name: Run installation script | ||
| run: | | ||
| chmod +x scripts/install_user_linux.sh && ./scripts/install_user_linux.sh | ||
|
|
||
| - name: Run example | ||
| run: poetry run python example.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Package Installation | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| windows-installation: | ||
|
|
||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install poetry | ||
|
|
||
| - name: Run installation script | ||
| run: | | ||
| ./scripts/install_user_windows.ps1 | ||
| poetry add pyqt5-qt5==5.15.2 | ||
|
|
||
| - name: Run example | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it ok to have an example run in an installation file? |
||
| run: poetry run python example.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| # Guide benchmarking | ||
|
|
||
| This guide is intended for those who plan to use the benchmarking of the pysatl-cpd project to analyze algorithms for finding change points. | ||
|
|
||
| ## Installation | ||
|
|
||
| Clone repository: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/PySATL/pysatl-cpd.git | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ### Linux | ||
|
|
||
| Go to repository folder and run installation script: | ||
|
|
||
| ```bash | ||
| cd pysatl-cpd | ||
| chmod +x scripts/install_user_linux.sh && ./scripts/install_user_linux.sh | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ### Windows | ||
|
|
||
| Go to repository folder and run installation script | ||
|
|
||
| ```shell | ||
| Set-Location pysatl-cpd | ||
| ./scripts/install_user_windows.ps1 | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## Data Generation | ||
|
|
||
| ### Available distributions | ||
|
|
||
| | Распределение | Название | Параметры | | ||
| | ------------------- | --------------------- | ------------------------------------------------------- | | ||
| | Normal | `normal` | `mean`, `variance` | | ||
| | Exponential | `exponential` | `rate` | | ||
| | Weibull | `weibull` | `shape`, `scale` | | ||
| | Uniform | `uniform` | `min`, `max` | | ||
| | Beta | `beta` | `alpha`, `beta` | | ||
| | Gamma | `gamma` | `alpha`, `beta` | | ||
| | t-Student | `t` | `n` | | ||
| | Lognormal | `lognorm` | `s` | | ||
| | Multivariate normal | `multivariate_normal` | `mean`, in the form of string of list, z `"[0.5, 2.0]"` | | ||
|
|
||
|
|
||
|
|
||
| ### How to configure? | ||
|
|
||
| To generate a test time series, create a new configuration file inside the `pysatl_cpd/examples/configs` directory. This file defines the segments that will be concatenated in order to create the final time series. | ||
|
|
||
| Structure of the config file: | ||
|
|
||
| ```yaml | ||
| - name: config_name | ||
| distributions: | ||
| - type: dist1 | ||
| length: length1 | ||
| parameters: | ||
| parameter1_1: value1_1 | ||
| parameter1_2: value1_2 | ||
| - type: dist2 | ||
| length: length2 | ||
| parameters: | ||
| parameter2_1: value2_1 | ||
| parameter2_2: value2_2 | ||
| # ... you can add more distribution segments here | ||
| ``` | ||
|
|
||
| **Fields**: | ||
|
|
||
| - `name`: A unique name for your configuration. | ||
| - `distributions`: A list of data segments to be generated. Each item in the list is a segment. | ||
| - `type`: The distribution type for the segment (e.g., normal, uniform). | ||
| - `length`: The length (number of data points) for this segment. | ||
| - `parameters`: The parameters required by the chosen distribution type (e.g., mean and variance for a normal distribution). | ||
|
|
||
|
|
||
|
|
||
| > Note: The available distribution types and their parameters must match the options listed in the table above. Please refer to it for a complete list of supported distributions and their required parameters. | ||
|
|
||
| ### Config example | ||
|
|
||
| ```yaml | ||
| - name: example | ||
| distributions: | ||
| - type: exponential | ||
| length: 200 | ||
| parameters: | ||
| rate: 2.0 | ||
| - type: beta | ||
| length: 200 | ||
| parameters: | ||
| alpha: 1.0 | ||
| beta: 5.0 | ||
| - type: uniform | ||
| length: 200 | ||
| parameters: | ||
| min: 0 | ||
| max: 0.5 | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## Algorithm configure | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this section is empty? |
||
|
|
||
|
|
||
| ## Experiment run | ||
|
|
||
| Run example in the main directory: | ||
|
|
||
| ```bash | ||
| poetry run python example.py | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Import error: cannot import matplotlib | ||
|
|
||
| If you saw a similar error when running the script: | ||
|
|
||
|  | ||
|
|
||
| And then you get this error: | ||
|
|
||
|  | ||
|
|
||
| Then try installing a lower version of the package: | ||
|
|
||
| ```bash | ||
| poetry add pyqt5-qt5==5.15.2 | ||
| ``` | ||
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| pip install poetry | ||
|
|
||
| py -3 -m venv .venv | ||
|
|
||
| . .\.venv\Scripts\Activate.ps1 | ||
| pip install poetry | ||
| poetry install --with-dev | ||
| deactivate |
3 changes: 3 additions & 0 deletions
3
create_user_venv.sh → scripts/install_user_linux.sh
100755 → 100644
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| pip install poetry | ||
|
|
||
| py -3 -m venv .venv | ||
|
|
||
| . .\.venv\Scripts\Activate.ps1 | ||
| pip install poetry | ||
| poetry install | ||
| deactivate |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok to have an example run in an installation file?