refloxide 0.1.3__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.
Files changed (66) hide show
  1. refloxide-0.1.3/.github/workflows/ci.yml +145 -0
  2. refloxide-0.1.3/.github/workflows/docs.yml +57 -0
  3. refloxide-0.1.3/.github/workflows/release.yml +110 -0
  4. refloxide-0.1.3/.gitignore +152 -0
  5. refloxide-0.1.3/.pre-commit-config.yaml +33 -0
  6. refloxide-0.1.3/AGENTS.md +225 -0
  7. refloxide-0.1.3/CHANGELOG.md +16 -0
  8. refloxide-0.1.3/CLAUDE.md +1 -0
  9. refloxide-0.1.3/Cargo.lock +488 -0
  10. refloxide-0.1.3/Cargo.toml +29 -0
  11. refloxide-0.1.3/LICENSE +16 -0
  12. refloxide-0.1.3/Makefile +58 -0
  13. refloxide-0.1.3/PKG-INFO +153 -0
  14. refloxide-0.1.3/README.md +129 -0
  15. refloxide-0.1.3/cliff.toml +49 -0
  16. refloxide-0.1.3/docs/api/index.md +13 -0
  17. refloxide-0.1.3/docs/api/python/pxr/index.md +8 -0
  18. refloxide-0.1.3/docs/api/python/pxr/tjf4x4.md +7 -0
  19. refloxide-0.1.3/docs/api/python/refloxide.md +8 -0
  20. refloxide-0.1.3/docs/api/rust.md +10 -0
  21. refloxide-0.1.3/docs/contributing.md +88 -0
  22. refloxide-0.1.3/docs/index.md +79 -0
  23. refloxide-0.1.3/docs/theory/eigenmode_analysis.md +214 -0
  24. refloxide-0.1.3/docs/theory/electric_field_distribution.md +247 -0
  25. refloxide-0.1.3/docs/theory/foundations.md +230 -0
  26. refloxide-0.1.3/docs/theory/history.md +134 -0
  27. refloxide-0.1.3/docs/theory/interface_matrices.md +392 -0
  28. refloxide-0.1.3/docs/theory/overview.md +434 -0
  29. refloxide-0.1.3/docs/theory/pipeline.md +136 -0
  30. refloxide-0.1.3/docs/theory/propagation_and_assembly.md +201 -0
  31. refloxide-0.1.3/docs/theory/reflection_transmission.md +231 -0
  32. refloxide-0.1.3/docs/theory/roughness_debye_waller.md +243 -0
  33. refloxide-0.1.3/docs/theory/roughness_framework.md +275 -0
  34. refloxide-0.1.3/docs/theory/roughness_graded_interface.md +324 -0
  35. refloxide-0.1.3/docs/theory/roughness_nevot_croce.md +265 -0
  36. refloxide-0.1.3/docs/theory/roughness_selection_guide.md +265 -0
  37. refloxide-0.1.3/examples/uniaxial_parity.py +343 -0
  38. refloxide-0.1.3/hooks.py +60 -0
  39. refloxide-0.1.3/mkdocs.yml +100 -0
  40. refloxide-0.1.3/pyproject.toml +157 -0
  41. refloxide-0.1.3/renovate.json +8 -0
  42. refloxide-0.1.3/scripts/smoke_release.sh +74 -0
  43. refloxide-0.1.3/src/c4x4.rs +109 -0
  44. refloxide-0.1.3/src/error.rs +61 -0
  45. refloxide-0.1.3/src/lib.rs +18 -0
  46. refloxide-0.1.3/src/math/exact_inv4.rs +175 -0
  47. refloxide-0.1.3/src/math/mod.rs +8 -0
  48. refloxide-0.1.3/src/python.rs +121 -0
  49. refloxide-0.1.3/src/refloxide/__init__.py +25 -0
  50. refloxide-0.1.3/src/refloxide/integrations/__init__.py +10 -0
  51. refloxide-0.1.3/src/refloxide/integrations/pyref.py +437 -0
  52. refloxide-0.1.3/src/refloxide/pxr/__init__.py +8 -0
  53. refloxide-0.1.3/src/refloxide/pxr/plotting.py +1 -0
  54. refloxide-0.1.3/src/refloxide/pxr/plugin/__init__.py +1 -0
  55. refloxide-0.1.3/src/refloxide/pxr/plugin/fitters.py +603 -0
  56. refloxide-0.1.3/src/refloxide/pxr/plugin/io.py +191 -0
  57. refloxide-0.1.3/src/refloxide/pxr/plugin/model.py +841 -0
  58. refloxide-0.1.3/src/refloxide/pxr/plugin/structure.py +1940 -0
  59. refloxide-0.1.3/src/refloxide/pxr/plugin/unittensor.py +169 -0
  60. refloxide-0.1.3/src/refloxide/pxr/stacks.py +330 -0
  61. refloxide-0.1.3/src/refloxide/pxr/tjf4x4.py +620 -0
  62. refloxide-0.1.3/src/refloxide/py.typed +0 -0
  63. refloxide-0.1.3/src/refloxide/rust.pyi +63 -0
  64. refloxide-0.1.3/src/uniaxial.rs +408 -0
  65. refloxide-0.1.3/tests/test_pyref_integration.py +131 -0
  66. refloxide-0.1.3/uv.lock +1991 -0
@@ -0,0 +1,145 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ env:
14
+ FORCE_COLOR: "1"
15
+
16
+ jobs:
17
+ lint:
18
+ name: Lint
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v4
25
+ with:
26
+ enable-cache: true
27
+
28
+ - name: Set up Rust
29
+ uses: dtolnay/rust-toolchain@stable
30
+
31
+ - name: Set up Python
32
+ run: uv python install 3.13
33
+
34
+ - name: Install dependencies
35
+ run: make install
36
+
37
+ - name: Lint and format check
38
+ run: make lint format-check
39
+
40
+ type-check:
41
+ name: Type Check
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+
46
+ - name: Install uv
47
+ uses: astral-sh/setup-uv@v4
48
+ with:
49
+ enable-cache: true
50
+
51
+ - name: Set up Rust
52
+ uses: dtolnay/rust-toolchain@stable
53
+
54
+ - name: Set up Python
55
+ run: uv python install 3.13
56
+
57
+ - name: Install dependencies
58
+ run: make install
59
+
60
+ - name: Run ty type checker
61
+ run: make type-check
62
+
63
+ test:
64
+ name: Test (Python ${{ matrix.python-version }})
65
+ runs-on: ubuntu-latest
66
+ strategy:
67
+ fail-fast: false
68
+ matrix:
69
+ python-version: ["3.13"]
70
+
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+
74
+ - name: Install uv
75
+ uses: astral-sh/setup-uv@v4
76
+ with:
77
+ enable-cache: true
78
+
79
+ - name: Set up Rust
80
+ uses: dtolnay/rust-toolchain@stable
81
+
82
+ - name: Set up Python ${{ matrix.python-version }}
83
+ run: uv python install ${{ matrix.python-version }}
84
+
85
+ - name: Install dependencies
86
+ run: make install
87
+
88
+ - name: Run tests with coverage
89
+ run: uv run --python ${{ matrix.python-version }} pytest --cov --cov-report=xml --cov-report=term-missing
90
+
91
+ - name: Upload coverage to Codecov
92
+ uses: codecov/codecov-action@v4
93
+ with:
94
+ token: ${{ secrets.CODECOV_TOKEN }}
95
+ files: ./coverage.xml
96
+ fail_ci_if_error: false
97
+
98
+ rust-check:
99
+ name: Rust Check
100
+ runs-on: ubuntu-latest
101
+ steps:
102
+ - uses: actions/checkout@v4
103
+
104
+ - name: Set up Rust
105
+ uses: dtolnay/rust-toolchain@stable
106
+ with:
107
+ components: rustfmt, clippy
108
+
109
+ - name: Check formatting
110
+ run: cargo fmt --all -- --check
111
+
112
+ - name: Compile crate
113
+ run: cargo check --all-targets
114
+
115
+ - name: Run clippy
116
+ run: cargo clippy --all-targets -- -D warnings
117
+
118
+ - name: Run Rust tests
119
+ run: cargo test --all-targets
120
+
121
+ dependency_scan:
122
+ name: Dependency Scan
123
+ runs-on: ubuntu-latest
124
+ steps:
125
+ - name: Checkout repository
126
+ uses: actions/checkout@v4
127
+ with:
128
+ fetch-depth: 0
129
+ - uses: astral-sh/setup-uv@v5
130
+ - uses: dtolnay/rust-toolchain@stable
131
+ - run: make install
132
+ - run: make pysentry
133
+
134
+ sast_with_semgrep:
135
+ name: semgrep scan
136
+ runs-on: ubuntu-latest
137
+ container:
138
+ image: semgrep/semgrep
139
+
140
+ # Skip any PRs created by dependabot or renovate to avoid permission issues:
141
+ if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.actor != 'Renovate[bot]' }}
142
+
143
+ steps:
144
+ - uses: actions/checkout@v4
145
+ - run: semgrep scan
@@ -0,0 +1,57 @@
1
+
2
+ name: Documentation
3
+
4
+ on:
5
+ push:
6
+ branches: [main]
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: "pages"
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v4
28
+ with:
29
+ enable-cache: true
30
+
31
+ - name: Set up Python
32
+ run: uv python install 3.13
33
+
34
+ - name: Install dependencies
35
+ run: make install
36
+
37
+ - name: Build documentation
38
+ run: make docs
39
+
40
+ - name: Setup Pages
41
+ uses: actions/configure-pages@v4
42
+
43
+ - name: Upload artifact
44
+ uses: actions/upload-pages-artifact@v3
45
+ with:
46
+ path: site
47
+
48
+ deploy:
49
+ environment:
50
+ name: github-pages
51
+ url: ${{ steps.deployment.outputs.page_url }}
52
+ runs-on: ubuntu-latest
53
+ needs: build
54
+ steps:
55
+ - name: Deploy to GitHub Pages
56
+ id: deployment
57
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,110 @@
1
+
2
+ name: Release
3
+
4
+ on:
5
+ push:
6
+ tags:
7
+ - "v*"
8
+
9
+ permissions:
10
+ contents: write
11
+ id-token: write
12
+
13
+ jobs:
14
+ build:
15
+ name: Build distribution
16
+ runs-on: ubuntu-22.04
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v4
24
+ with:
25
+ enable-cache: true
26
+
27
+ - uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.13"
30
+
31
+ - name: Build source distribution
32
+ run: uv build --sdist -o dist --clear
33
+
34
+ - uses: PyO3/maturin-action@v1
35
+ with:
36
+ command: build
37
+ args: --release --out dist --compatibility pypi --find-interpreter
38
+ manylinux: auto
39
+
40
+ - name: Assert wheel platform tag
41
+ run: |
42
+ python - <<'PY'
43
+ import glob
44
+ import sys
45
+
46
+ wheels = glob.glob("dist/*.whl")
47
+ if not wheels:
48
+ sys.exit("no wheel in dist/")
49
+ name = wheels[0].split("/")[-1]
50
+ if name.endswith("linux_x86_64.whl"):
51
+ sys.exit(f"unsupported platform tag in {name}")
52
+ if "manylinux" not in name and "musllinux" not in name:
53
+ sys.exit(f"expected manylinux/musllinux tag in {name}")
54
+ print(f"OK: {name}")
55
+ PY
56
+
57
+ - name: Store distribution packages
58
+ uses: actions/upload-artifact@v4
59
+ with:
60
+ name: python-package-distributions
61
+ path: dist/
62
+
63
+ publish-pypi:
64
+ name: Publish to PyPI
65
+ needs: [build]
66
+ runs-on: ubuntu-latest
67
+ environment:
68
+ name: pypi
69
+ url: https://pypi.org/p/refloxide
70
+ steps:
71
+ - name: Download distributions
72
+ uses: actions/download-artifact@v4
73
+ with:
74
+ name: python-package-distributions
75
+ path: dist/
76
+
77
+ - name: Publish to PyPI
78
+ uses: pypa/gh-action-pypi-publish@release/v1
79
+
80
+ github-release:
81
+ name: Create GitHub Release
82
+ needs: [publish-pypi]
83
+ runs-on: ubuntu-latest
84
+ steps:
85
+ - name: Check out repository
86
+ uses: actions/checkout@v4
87
+ with:
88
+ fetch-depth: 0
89
+
90
+ - name: Download distributions
91
+ uses: actions/download-artifact@v4
92
+ with:
93
+ name: python-package-distributions
94
+ path: dist/
95
+
96
+ - name: Generate a changelog
97
+ uses: orhun/git-cliff-action@v4
98
+ with:
99
+ config: cliff.toml
100
+ args: --verbose
101
+ env:
102
+ OUTPUT: RELEASE_NOTES.md
103
+ GITHUB_REPO: ${{ github.repository }}
104
+
105
+ - name: Create GitHub Release
106
+ uses: softprops/action-gh-release@v2
107
+ with:
108
+ body_path: RELEASE_NOTES.md
109
+ files: dist/*
110
+ generate_release_notes: false
@@ -0,0 +1,152 @@
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
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # Django stuff:
56
+ *.log
57
+ local_settings.py
58
+ db.sqlite3
59
+ db.sqlite3-journal
60
+
61
+ # Flask stuff:
62
+ instance/
63
+ .webassets-cache
64
+
65
+ # Scrapy stuff:
66
+ .scrapy
67
+
68
+ # Sphinx documentation
69
+ docs/_build/
70
+
71
+ # PyBuilder
72
+ .pybuilder/
73
+ target/
74
+
75
+ # Jupyter Notebook
76
+ .ipynb_checkpoints
77
+
78
+ # IPython
79
+ profile_default/
80
+ ipython_config.py
81
+
82
+ # pyenv
83
+ .python-version
84
+
85
+ # pipenv
86
+ Pipfile.lock
87
+
88
+ # PEP 582
89
+ __pypackages__/
90
+
91
+ # Celery stuff
92
+ celerybeat-schedule
93
+ celerybeat.pid
94
+
95
+ # SageMath parsed files
96
+ *.sage.py
97
+
98
+ # Environments
99
+ .env
100
+ .venv
101
+ .smoke-venv
102
+ env/
103
+ venv/
104
+ ENV/
105
+ env.bak/
106
+ venv.bak/
107
+
108
+ # Spyder project settings
109
+ .spyderproject
110
+ .spyproject
111
+
112
+ # Rope project settings
113
+ .ropeproject
114
+
115
+ # mkdocs documentation
116
+ /site
117
+ /docs/rustdoc/
118
+
119
+ # mypy
120
+ .mypy_cache/
121
+ .dmypy.json
122
+ dmypy.json
123
+
124
+ # Pyre type checker
125
+ .pyre/
126
+
127
+ # ruff
128
+ .ruff_cache/
129
+
130
+ # ty
131
+ .ty_cache/
132
+
133
+ # IDE
134
+ .idea/
135
+ .vscode/
136
+ *.swp
137
+ *.swo
138
+ *~
139
+
140
+ # OS
141
+ .DS_Store
142
+ Thumbs.db
143
+
144
+ # Project specific
145
+ *.log
146
+ .env.*
147
+ !.env.example
148
+
149
+ # Agents muck things up globally
150
+ .cursor/
151
+ .agents/
152
+ .vscode/mkdocs-validate.yml
@@ -0,0 +1,33 @@
1
+ # Prek hooks configuration
2
+ # See https://prek.j178.dev for more information
3
+
4
+ repos:
5
+ # General hooks
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v5.0.0
8
+ hooks:
9
+ - id: trailing-whitespace
10
+ - id: end-of-file-fixer
11
+ - id: check-yaml
12
+ - id: check-toml
13
+ - id: check-added-large-files
14
+ - id: check-merge-conflict
15
+ - id: debug-statements
16
+
17
+ # Ruff - Fast Python linter and formatter
18
+ - repo: https://github.com/astral-sh/ruff-pre-commit
19
+ rev: v0.8.4
20
+ hooks:
21
+ - id: ruff
22
+ args: [--fix]
23
+ - id: ruff-format
24
+
25
+ # ty - Astral's type checker (local hook since no prek repo yet)
26
+ - repo: local
27
+ hooks:
28
+ - id: ty
29
+ name: ty type checker
30
+ entry: uv run ty check
31
+ language: system
32
+ types: [python]
33
+ pass_filenames: false