tf2ss 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: '[BUG] '
5
+ labels: 'bug'
6
+ assignees: 'MarekWadinger'
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+
16
+ 1. Import/setup code
17
+ 2. Run specific function
18
+ 3. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Code Example**
24
+
25
+ ```python
26
+ # Please provide a minimal working example that reproduces the issue
27
+ import tf2ss
28
+
29
+ # Your code here
30
+ ```
31
+
32
+ **Error Message**
33
+ If applicable, paste the full error message/traceback here.
34
+
35
+ **Environment (please complete the following information):**
36
+
37
+ - OS: [e.g. Windows, macOS, Linux]
38
+ - Python version: [e.g. 3.10, 3.11, 3.12]
39
+ - tf2ss version: [e.g. 1.0.0]
40
+ - Other relevant package versions: [e.g. numpy 1.24.0, scipy 1.10.0]
41
+
42
+ **Additional context**
43
+ Add any other context about the problem here.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: '[FEATURE] '
5
+ labels: 'enhancement'
6
+ assignees: 'MarekWadinger'
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Use case**
20
+ Describe the specific use case or application where this feature would be helpful.
21
+
22
+ **Implementation ideas**
23
+ If you have ideas about how this could be implemented, please share them here.
24
+
25
+ **Additional context**
26
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,27 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ open-pull-requests-limit: 10
8
+ reviewers:
9
+ - "MarekWadinger"
10
+ assignees:
11
+ - "MarekWadinger"
12
+ commit-message:
13
+ prefix: "deps"
14
+ include: "scope"
15
+
16
+ - package-ecosystem: "github-actions"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "weekly"
20
+ open-pull-requests-limit: 5
21
+ reviewers:
22
+ - "MarekWadinger"
23
+ assignees:
24
+ - "MarekWadinger"
25
+ commit-message:
26
+ prefix: "ci"
27
+ include: "scope"
@@ -0,0 +1,41 @@
1
+ ## Description
2
+
3
+ Brief description of the changes made in this pull request.
4
+
5
+ ## Type of Change
6
+
7
+ Please delete options that are not relevant.
8
+
9
+ - [ ] Bug fix (non-breaking change which fixes an issue)
10
+ - [ ] New feature (non-breaking change which adds functionality)
11
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12
+ - [ ] Documentation update
13
+ - [ ] Code refactoring (no functional changes)
14
+ - [ ] Performance improvement
15
+ - [ ] Test improvements
16
+
17
+ ## Related Issues
18
+
19
+ Fixes #(issue number)
20
+
21
+ ## Testing
22
+
23
+ - [ ] Tests pass locally with my changes
24
+ - [ ] I have added tests that prove my fix is effective or that my feature works
25
+ - [ ] New and existing unit tests pass locally with my changes
26
+
27
+ ## Code Quality
28
+
29
+ - [ ] My code follows the style guidelines of this project
30
+ - [ ] I have performed a self-review of my own code
31
+ - [ ] I have commented my code, particularly in hard-to-understand areas
32
+ - [ ] I have made corresponding changes to the documentation
33
+ - [ ] My changes generate no new warnings
34
+
35
+ ## Breaking Changes
36
+
37
+ If this is a breaking change, please describe the impact and migration path for existing users:
38
+
39
+ ## Additional Notes
40
+
41
+ Any additional information that reviewers should know about this pull request.
@@ -0,0 +1,83 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, windows-latest, macos-latest]
15
+ python-version: ["3.10", "3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v3
22
+ with:
23
+ version: "latest"
24
+
25
+ - name: Set up Python ${{ matrix.python-version }}
26
+ run: uv python install ${{ matrix.python-version }}
27
+
28
+ - name: Install dependencies
29
+ run: uv sync --extra test
30
+
31
+ - name: Test with pytest
32
+ run: uv run pytest --cov=tf2ss --cov-report=xml --cov-report=term-missing
33
+
34
+ - name: Upload coverage to Codecov
35
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
36
+ uses: codecov/codecov-action@v5
37
+ with:
38
+ token: ${{ secrets.CODECOV_TOKEN }}
39
+
40
+ lint:
41
+ runs-on: ubuntu-latest
42
+
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+
46
+ - name: Install uv
47
+ uses: astral-sh/setup-uv@v3
48
+ with:
49
+ version: "latest"
50
+
51
+ - name: Set up Python
52
+ run: uv python install 3.11
53
+
54
+ - name: Install dependencies
55
+ run: uv sync --extra dev
56
+
57
+ - name: Lint with ruff
58
+ run: uv run ruff check .
59
+
60
+ - name: Type check with mypy
61
+ run: uv run mypy tf2ss/
62
+
63
+ build:
64
+ runs-on: ubuntu-latest
65
+ needs: [test, lint]
66
+
67
+ steps:
68
+ - uses: actions/checkout@v4
69
+
70
+ - name: Install uv
71
+ uses: astral-sh/setup-uv@v3
72
+ with:
73
+ version: "latest"
74
+
75
+ - name: Set up Python
76
+ run: uv python install 3.11
77
+
78
+ - name: Build package
79
+ run: uv build
80
+
81
+ - name: Check package
82
+ run: |
83
+ uv tool run twine check dist/*
@@ -0,0 +1,32 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ environment: release
11
+ permissions:
12
+ id-token: write # For trusted publishing
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v3
19
+ with:
20
+ version: "latest"
21
+
22
+ - name: Set up Python
23
+ run: uv python install 3.11
24
+
25
+ - name: Build package
26
+ run: uv build
27
+
28
+ - name: Check package
29
+ run: uv tool run twine check dist/*
30
+
31
+ - name: Publish to PyPI
32
+ uses: pypa/gh-action-pypi-publish@release/v1
tf2ss-1.0.0/.gitignore ADDED
@@ -0,0 +1,179 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # pdm
98
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
99
+ #pdm.lock
100
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
101
+ # in version control.
102
+ # https://pdm.fming.dev/#use-with-ide
103
+ .pdm.toml
104
+
105
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
106
+ __pypackages__/
107
+
108
+ # Celery stuff
109
+ celerybeat-schedule
110
+ celerybeat.pid
111
+
112
+ # SageMath parsed files
113
+ *.sage.py
114
+
115
+ # Environments
116
+ .env
117
+ .venv
118
+ env/
119
+ venv/
120
+ ENV/
121
+ env.bak/
122
+ venv.bak/
123
+
124
+ # Spyder project settings
125
+ .spyderproject
126
+ .spyproject
127
+
128
+ # Rope project settings
129
+ .ropeproject
130
+
131
+ # mkdocs documentation
132
+ /site
133
+
134
+ # mypy
135
+ .mypy_cache/
136
+ .dmypy.json
137
+ dmypy.json
138
+
139
+ # Pyre type checker
140
+ .pyre/
141
+
142
+ # pytype static type analyzer
143
+ .pytype/
144
+
145
+ # Cython debug symbols
146
+ cython_debug/
147
+
148
+ # PyCharm
149
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
150
+ # be added to the global gitignore or merged into this project gitignore. For a PyCharm
151
+ # project, it is recommended to exclude the whole .idea directory.
152
+ .idea/
153
+
154
+ # VS Code
155
+ .vscode/
156
+
157
+ # macOS
158
+ .DS_Store
159
+
160
+ # Windows
161
+ Thumbs.db
162
+ ehthumbs.db
163
+ Desktop.ini
164
+
165
+ # Linux
166
+ *~
167
+
168
+ # Temporary files
169
+ *.tmp
170
+ *.temp
171
+ *.bak
172
+ *.swp
173
+ *.swo
174
+
175
+ # Project specific
176
+ examples/
177
+ notebooks/
178
+ *.mat
179
+ *.fig
@@ -0,0 +1,75 @@
1
+ # https://pre-commit.com
2
+ exclude: "examples|reports"
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v5.0.0
6
+ hooks:
7
+ - id: debug-statements #Check for debugger imports and breakpoint() in python files
8
+ - id: check-ast #Simply check whether files parse as valid python
9
+ - id: fix-byte-order-marker #removes UTF-8 byte order marker
10
+ - id: check-json
11
+ - id: detect-private-key # detect-private-key is not in repo
12
+ - id: check-yaml
13
+ - id: check-added-large-files
14
+ - id: check-shebang-scripts-are-executable
15
+ - id: check-case-conflict #Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT
16
+ - id: end-of-file-fixer #Makes sure files end in a newline and only a newline
17
+ - id: trailing-whitespace
18
+ - id: mixed-line-ending
19
+ - id: no-commit-to-branch
20
+ args: ['--pattern', 'TODO|todo|fixme|FIXME']
21
+ stages: [pre-push]
22
+ - repo: local
23
+ hooks:
24
+ - id: ruff
25
+ name: ruff
26
+ entry: ruff check
27
+ language: python
28
+ args: [--fix, --exit-non-zero-on-fix, --line-length=79]
29
+ types_or: [python, pyi, jupyter]
30
+ - id: ruff-format
31
+ name: ruff-format
32
+ entry: ruff format
33
+ language: python
34
+ args: [--line-length=79]
35
+ types_or: [python, pyi, jupyter]
36
+ - repo: https://github.com/asottile/blacken-docs
37
+ rev: 1.19.1
38
+ hooks:
39
+ - id: blacken-docs #blacken-docs is a pre-commit hook that runs to check for issues in the docs
40
+ additional_dependencies: [black]
41
+ - repo: local
42
+ hooks:
43
+ - id: mypy # mypy is a pre-commit hook that runs as a linter to check for type errors
44
+ name: mypy
45
+ entry: mypy
46
+ language: system
47
+ types: [python]
48
+ stages:
49
+ - "pre-push"
50
+ - "pre-merge-commit"
51
+ - repo: local
52
+ hooks:
53
+ - id: pytest-check
54
+ name: pytest-check
55
+ language: system
56
+ types: [python]
57
+ entry: pytest
58
+ pass_filenames: false
59
+ always_run: true
60
+ args: [--doctest-modules]
61
+ stages: [pre-push]
62
+ - repo: https://github.com/roy-ht/pre-commit-jupyter
63
+ rev: v1.2.1
64
+ hooks:
65
+ - id: jupyter-notebook-cleanup
66
+ args:
67
+ - --remove-kernel-metadata
68
+ - --pin-patterns
69
+ - "[pin];[donotremove]"
70
+ - repo: https://github.com/commitizen-tools/commitizen
71
+ rev: v4.4.1
72
+ hooks:
73
+ - id: commitizen
74
+ - id: commitizen-branch
75
+ stages: [pre-push]
@@ -0,0 +1,44 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The CHANGELOG is powered by [Commitizen](https://commitizen-tools.github.io/commitizen/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ### Added
10
+
11
+ - Initial release preparation
12
+
13
+ ## [1.0.0] - 2025-05-29
14
+
15
+ ### Added
16
+
17
+ - feat: initial release of tf2ss package
18
+ - feat: transfer function to state-space conversion for MIMO systems
19
+ - feat: support for both coefficient lists and control library objects
20
+ - feat: minimal realization option
21
+ - feat: time response analysis with `forced_response` function
22
+ - test: comprehensive test suite with SLYCOT and MATLAB validation
23
+ - docs: documentation and examples
24
+ - ci: GitHub Actions CI/CD pipeline
25
+ - chore: pre-commit hooks for code quality
26
+
27
+ ### Features
28
+
29
+ - feat: full support for Multi-Input Multi-Output systems
30
+ - feat: robust algorithms for accurate conversion
31
+ - feat: seamless integration with Python Control library
32
+ - feat: automatic LCM computation for denominators
33
+ - feat: system poles and zeros preservation
34
+
35
+ ### Dependencies
36
+
37
+ - numpy >= 1.20.0
38
+ - scipy >= 1.7.0
39
+ - sympy >= 1.8
40
+ - control >= 0.9.0
41
+ - Python >= 3.10
42
+
43
+ [Unreleased]: https://github.com/mwadinger/tf2ss/compare/v1.0.0...HEAD
44
+ [1.0.0]: https://github.com/mwadinger/tf2ss/releases/tag/v1.0.0