pydalec 0.1.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.
Files changed (102) hide show
  1. pydalec-0.1.0/.cruft.json +25 -0
  2. pydalec-0.1.0/.gitattributes +59 -0
  3. pydalec-0.1.0/.github/copilot-instructions.md +4 -0
  4. pydalec-0.1.0/.github/workflows/ci.yml +63 -0
  5. pydalec-0.1.0/.gitignore +77 -0
  6. pydalec-0.1.0/.pre-commit-config.yaml +102 -0
  7. pydalec-0.1.0/.python-version +1 -0
  8. pydalec-0.1.0/CHANGELOG.md +31 -0
  9. pydalec-0.1.0/LICENSE +674 -0
  10. pydalec-0.1.0/Makefile +115 -0
  11. pydalec-0.1.0/PKG-INFO +817 -0
  12. pydalec-0.1.0/README.md +112 -0
  13. pydalec-0.1.0/assets/images/README +1 -0
  14. pydalec-0.1.0/docs/Makefile +20 -0
  15. pydalec-0.1.0/docs/make.bat +36 -0
  16. pydalec-0.1.0/docs/source/conf.py +70 -0
  17. pydalec-0.1.0/docs/source/index.rst +21 -0
  18. pydalec-0.1.0/docs/source/readme_link.md +3 -0
  19. pydalec-0.1.0/docs/source/usage.rst +10 -0
  20. pydalec-0.1.0/htmlcov/.gitignore +2 -0
  21. pydalec-0.1.0/htmlcov/class_index.html +391 -0
  22. pydalec-0.1.0/htmlcov/coverage_html_cb_dd2e7eb5.js +735 -0
  23. pydalec-0.1.0/htmlcov/favicon_32_cb_c827f16f.png +0 -0
  24. pydalec-0.1.0/htmlcov/function_index.html +1051 -0
  25. pydalec-0.1.0/htmlcov/index.html +207 -0
  26. pydalec-0.1.0/htmlcov/keybd_closed_cb_900cfef5.png +0 -0
  27. pydalec-0.1.0/htmlcov/status.json +1 -0
  28. pydalec-0.1.0/htmlcov/style_cb_4667309f.css +391 -0
  29. pydalec-0.1.0/htmlcov/style_cb_9ff733b0.css +389 -0
  30. pydalec-0.1.0/htmlcov/z_64f2b7f482cc053e___init___py.html +109 -0
  31. pydalec-0.1.0/htmlcov/z_64f2b7f482cc053e___version___py.html +107 -0
  32. pydalec-0.1.0/htmlcov/z_64f2b7f482cc053e_cli_py.html +289 -0
  33. pydalec-0.1.0/htmlcov/z_64f2b7f482cc053e_errors_py.html +111 -0
  34. pydalec-0.1.0/htmlcov/z_64f2b7f482cc053e_instrument_py.html +309 -0
  35. pydalec-0.1.0/htmlcov/z_64f2b7f482cc053e_logging_utils_py.html +120 -0
  36. pydalec-0.1.0/htmlcov/z_64f2b7f482cc053e_measurement_py.html +402 -0
  37. pydalec-0.1.0/htmlcov/z_7336340e30407d7c___init___py.html +109 -0
  38. pydalec-0.1.0/htmlcov/z_7336340e30407d7c___version___py.html +107 -0
  39. pydalec-0.1.0/htmlcov/z_7336340e30407d7c_cli_py.html +289 -0
  40. pydalec-0.1.0/htmlcov/z_7336340e30407d7c_errors_py.html +111 -0
  41. pydalec-0.1.0/htmlcov/z_7336340e30407d7c_instrument_py.html +309 -0
  42. pydalec-0.1.0/htmlcov/z_7336340e30407d7c_logging_utils_py.html +120 -0
  43. pydalec-0.1.0/htmlcov/z_7336340e30407d7c_measurement_py.html +402 -0
  44. pydalec-0.1.0/htmlcov/z_b8e868f4e7427497___init___py.html +101 -0
  45. pydalec-0.1.0/htmlcov/z_b8e868f4e7427497_base_py.html +154 -0
  46. pydalec-0.1.0/htmlcov/z_b8e868f4e7427497_mock_py.html +155 -0
  47. pydalec-0.1.0/htmlcov/z_b8e868f4e7427497_tcp_py.html +405 -0
  48. pydalec-0.1.0/htmlcov/z_df9c719c28db05d3___init___py.html +101 -0
  49. pydalec-0.1.0/htmlcov/z_df9c719c28db05d3_base_py.html +154 -0
  50. pydalec-0.1.0/htmlcov/z_df9c719c28db05d3_mock_py.html +155 -0
  51. pydalec-0.1.0/htmlcov/z_df9c719c28db05d3_tcp_py.html +405 -0
  52. pydalec-0.1.0/htmlcov/z_eb534fee540aad9e___init___py.html +109 -0
  53. pydalec-0.1.0/htmlcov/z_eb534fee540aad9e___version___py.html +107 -0
  54. pydalec-0.1.0/htmlcov/z_eb534fee540aad9e_cli_py.html +289 -0
  55. pydalec-0.1.0/htmlcov/z_eb534fee540aad9e_errors_py.html +111 -0
  56. pydalec-0.1.0/htmlcov/z_eb534fee540aad9e_instrument_py.html +309 -0
  57. pydalec-0.1.0/htmlcov/z_eb534fee540aad9e_logging_utils_py.html +120 -0
  58. pydalec-0.1.0/htmlcov/z_eb534fee540aad9e_measurement_py.html +402 -0
  59. pydalec-0.1.0/htmlcov/z_f028b86411b1e82a___init___py.html +101 -0
  60. pydalec-0.1.0/htmlcov/z_f028b86411b1e82a_base_py.html +154 -0
  61. pydalec-0.1.0/htmlcov/z_f028b86411b1e82a_mock_py.html +155 -0
  62. pydalec-0.1.0/htmlcov/z_f028b86411b1e82a_tcp_py.html +405 -0
  63. pydalec-0.1.0/htmlcov/z_f02b1019b0d3788a___init___py.html +109 -0
  64. pydalec-0.1.0/htmlcov/z_f02b1019b0d3788a___version___py.html +107 -0
  65. pydalec-0.1.0/htmlcov/z_f02b1019b0d3788a_cli_py.html +289 -0
  66. pydalec-0.1.0/htmlcov/z_f02b1019b0d3788a_errors_py.html +111 -0
  67. pydalec-0.1.0/htmlcov/z_f02b1019b0d3788a_instrument_py.html +309 -0
  68. pydalec-0.1.0/htmlcov/z_f02b1019b0d3788a_logging_utils_py.html +120 -0
  69. pydalec-0.1.0/htmlcov/z_f02b1019b0d3788a_measurement_py.html +402 -0
  70. pydalec-0.1.0/htmlcov/z_f56beeea0ef05612___init___py.html +101 -0
  71. pydalec-0.1.0/htmlcov/z_f56beeea0ef05612_base_py.html +154 -0
  72. pydalec-0.1.0/htmlcov/z_f56beeea0ef05612_mock_py.html +155 -0
  73. pydalec-0.1.0/htmlcov/z_f56beeea0ef05612_tcp_py.html +405 -0
  74. pydalec-0.1.0/pydalec_mock/pyproject.toml +23 -0
  75. pydalec-0.1.0/pydalec_mock/src/pydalec_mock/__init__.py +1 -0
  76. pydalec-0.1.0/pydalec_mock/src/pydalec_mock/__main__.py +6 -0
  77. pydalec-0.1.0/pydalec_mock/src/pydalec_mock/async_server.py +38 -0
  78. pydalec-0.1.0/pydalec_mock/src/pydalec_mock/protocol.py +8 -0
  79. pydalec-0.1.0/pydalec_mock/src/pydalec_mock/state.py +10 -0
  80. pydalec-0.1.0/pyproject.toml +214 -0
  81. pydalec-0.1.0/requirements.txt +775 -0
  82. pydalec-0.1.0/src/pydalec/__init__.py +12 -0
  83. pydalec-0.1.0/src/pydalec/__version__.py +10 -0
  84. pydalec-0.1.0/src/pydalec/cli.py +192 -0
  85. pydalec-0.1.0/src/pydalec/errors.py +14 -0
  86. pydalec-0.1.0/src/pydalec/instrument.py +212 -0
  87. pydalec-0.1.0/src/pydalec/logging_utils.py +23 -0
  88. pydalec-0.1.0/src/pydalec/measurement.py +305 -0
  89. pydalec-0.1.0/src/pydalec/transport/__init__.py +4 -0
  90. pydalec-0.1.0/src/pydalec/transport/base.py +57 -0
  91. pydalec-0.1.0/src/pydalec/transport/mock.py +58 -0
  92. pydalec-0.1.0/src/pydalec/transport/tcp.py +308 -0
  93. pydalec-0.1.0/tests/test_cli.py +152 -0
  94. pydalec-0.1.0/tests/test_client.py +393 -0
  95. pydalec-0.1.0/tests/test_logging.py +54 -0
  96. pydalec-0.1.0/tests/test_measurement.py +405 -0
  97. pydalec-0.1.0/tests/transport/test_transport_base.py +52 -0
  98. pydalec-0.1.0/tests/transport/test_transport_mock.py +68 -0
  99. pydalec-0.1.0/tests/transport/test_transport_tcp.py +434 -0
  100. pydalec-0.1.0/todo.md +5 -0
  101. pydalec-0.1.0/tox.ini +7 -0
  102. pydalec-0.1.0/uv.lock +1331 -0
@@ -0,0 +1,25 @@
1
+ {
2
+ "template": "https://www.github.com/dietervansteenwegen/python_cookie.git",
3
+ "commit": "f9d6d168b2f62fb5d3644414600572487fdee418",
4
+ "checkout": null,
5
+ "context": {
6
+ "cookiecutter": {
7
+ "project_name": "pyDALEC",
8
+ "project_name_short": "pydalec",
9
+ "project_link": "https://www.boxfish.be",
10
+ "module_name": "pydalec",
11
+ "class_name": "PyDalec",
12
+ "project_description": "Driver for the In-situ Marine Optics Dynamic Above-water radiance (L) and irradiance (E) Collector (DALEC).",
13
+ "keywords": "DALEC",
14
+ "use_config_file": false,
15
+ "add_documentation": true,
16
+ "add_gui": false,
17
+ "create_assets_dir": true,
18
+ "add_data_dir": true,
19
+ "create_env_template": false,
20
+ "_template": "https://www.github.com/dietervansteenwegen/python_cookie.git",
21
+ "_commit": "f9d6d168b2f62fb5d3644414600572487fdee418"
22
+ }
23
+ },
24
+ "directory": null
25
+ }
@@ -0,0 +1,59 @@
1
+ # Basic .gitattributes for a python repo.
2
+
3
+ # Set the default behavior, in case people don't have core.autocrlf set.
4
+ * text=auto
5
+
6
+ # Source files
7
+ # ============
8
+ *.pxd text diff=python
9
+ *.py text diff=python eol=lf
10
+ *.py3 text diff=python
11
+ *.pyw text diff=python
12
+ *.pyx text diff=python
13
+ *.pyz text diff=python
14
+
15
+ # Binary files
16
+ # ============
17
+ *.db binary
18
+ *.p binary
19
+ *.pkl binary
20
+ *.pickle binary
21
+ *.pyc binary
22
+ *.pyd binary
23
+ *.pyo binary
24
+
25
+
26
+ # General filetypes:
27
+ # Documents
28
+ *.md text diff=markdown
29
+ *.csv text
30
+ *.tab text
31
+ *.txt text
32
+ *.sql text
33
+ *.ps1 text eol=crlf
34
+
35
+
36
+ # Scripts
37
+ *.bash text eol=lf
38
+ *.sh text eol=lf
39
+ # These are explicitly windows files and should use crlf
40
+ *.bat text eol=crlf
41
+ *.cmd text eol=crlf
42
+
43
+ # Serialisation
44
+ *.json text
45
+ *.toml text
46
+ *.xml text
47
+ *.yaml text
48
+ *.yml text
49
+
50
+ # Text files where line endings should be preserved
51
+ *.patch -text
52
+
53
+ #
54
+ # Exclude files from exporting
55
+ #
56
+
57
+ .gitattributes export-ignore
58
+ .gitignore export-ignore
59
+ .gitkeep export-ignore
@@ -0,0 +1,4 @@
1
+ # Repository-wide Copilot Instructions
2
+
3
+ - Whenever making significant changes, update `CHANGELOG.md` in the "Not released yet" section.
4
+ - Keep changelog entries brief (max 60 characters) and prefix each new entry with `<copilot>`.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: CI
3
+
4
+ on:
5
+ push:
6
+ branches:
7
+ - master
8
+ pull_request:
9
+
10
+ jobs:
11
+ tox:
12
+ name: Tox (${{ matrix.toxenv }})
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ include:
18
+ - python-version: '3.11'
19
+ toxenv: py311
20
+ - python-version: '3.12'
21
+ toxenv: py312
22
+ - python-version: '3.13'
23
+ toxenv: py313
24
+
25
+ steps:
26
+ - name: Checkout
27
+ uses: actions/checkout@v4
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: ${{ matrix.python-version }}
33
+
34
+ - name: Set up uv
35
+ uses: astral-sh/setup-uv@v4
36
+
37
+ - name: Install dev dependencies
38
+ run: uv sync --group dev
39
+
40
+ - name: Run tox
41
+ run: uv run tox -e ${{ matrix.toxenv }}
42
+
43
+ pre-commit:
44
+ name: Pre-commit hooks
45
+ runs-on: ubuntu-latest
46
+
47
+ steps:
48
+ - name: Checkout
49
+ uses: actions/checkout@v4
50
+
51
+ - name: Set up Python
52
+ uses: actions/setup-python@v5
53
+ with:
54
+ python-version: '3.13'
55
+
56
+ - name: Set up uv
57
+ uses: astral-sh/setup-uv@v4
58
+
59
+ - name: Install dev dependencies
60
+ run: uv sync --group dev
61
+
62
+ - name: Run all pre-commit hooks
63
+ run: uv run pre-commit run --all-files
@@ -0,0 +1,77 @@
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
+ dist/
13
+ sdist/
14
+ wheels/
15
+ *.egg-info/
16
+ *.egg
17
+
18
+ # Pytest:
19
+ .coverage
20
+ .tox
21
+
22
+ # Flask stuff:
23
+ instance/
24
+ .webassets-cache
25
+
26
+ # Sphinx documentation
27
+ docs/build/
28
+
29
+ # Environments
30
+ venv/
31
+ .venv/
32
+
33
+ # mypy
34
+ .mypy_cache/
35
+ .dmypy.json
36
+ dmypy.json
37
+
38
+ # Cython debug symbols
39
+ cython_debug/
40
+
41
+ ### zip files ###
42
+ *.zip
43
+
44
+ ### Credentials file
45
+ credentials*
46
+
47
+ # ### VisualStudioCode ###
48
+ .vscode/
49
+ !.vscode/settings.json
50
+ !.vscode/tasks.json
51
+ !.vscode/launch.json
52
+ # !.vscode/extensions.json
53
+
54
+ ### Ruff files ###
55
+ .ruff_cache/
56
+
57
+ ### Environment files
58
+ .env
59
+ .env.*
60
+
61
+ ### Own application logs
62
+ *.log
63
+ *.log.1
64
+ *.log.2
65
+ *.log.3
66
+ *.log.4
67
+ *.log.5
68
+ logs/
69
+
70
+ ### Own generated files
71
+ *.pdf
72
+ *.svg
73
+ *.csv
74
+ *.db
75
+ sourcetrail/
76
+ generated/
77
+ pydalec.code-workspace
@@ -0,0 +1,102 @@
1
+ ---
2
+ # exclude:
3
+ fail_fast: false
4
+ minimum_pre_commit_version: 3.0.0
5
+
6
+ repos:
7
+ # Python
8
+ - repo: local
9
+ hooks:
10
+ - id: format
11
+ name: Format
12
+ entry: uv run ruff format
13
+ language: system
14
+ types: [python]
15
+
16
+ - id: lint
17
+ name: Lint
18
+ entry: uv run ruff check
19
+ language: system
20
+ types: [python]
21
+
22
+ # Pre-commit versions self-update
23
+ - repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
24
+ rev: v0.9.0
25
+ hooks:
26
+ - id: pre-commit-update
27
+ args: [--dry-run]
28
+
29
+ # Markdown, see https://pymarkdown.readthedocs.io/en/latest/rules/ for rules/config
30
+ - repo: https://github.com/jackdewinter/pymarkdown/
31
+ rev: v0.9.37
32
+ hooks:
33
+ - id: pymarkdown
34
+ args: [--config, pyproject.toml, scan]
35
+ types: [markdown]
36
+
37
+ # YAML
38
+ - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
39
+ rev: 0.2.3
40
+ hooks:
41
+ - id: yamlfmt
42
+ args: [--mapping, '4', --sequence, '4', --offset, '2', --width, '120']
43
+ types: [yaml]
44
+
45
+ # All files + miscellaneous
46
+ - repo: https://github.com/pre-commit/pre-commit-hooks
47
+ rev: v6.0.0
48
+ hooks:
49
+ - id: check-added-large-files
50
+ args: [--maxkb=500]
51
+ - id: forbid-new-submodules
52
+ - id: no-commit-to-branch
53
+ args: [--branch, master]
54
+ - id: end-of-file-fixer
55
+ - id: trailing-whitespace
56
+ types: [text]
57
+ - id: fix-byte-order-marker
58
+ types: [text]
59
+ - id: mixed-line-ending
60
+ args: [--fix=auto]
61
+ types: [text]
62
+ - id: check-merge-conflict
63
+ types: [text]
64
+ - id: detect-private-key
65
+ types: [text]
66
+ - id: check-executables-have-shebangs
67
+ types: [text, executable]
68
+ - id: check-shebang-scripts-are-executable
69
+ types: [text]
70
+ - id: check-json
71
+ types: [json]
72
+ - id: pretty-format-json
73
+ args: [--no-sort-keys, --autofix, --no-ensure-ascii]
74
+ types: [json]
75
+ - id: check-symlinks
76
+ types: [symlink]
77
+ - id: destroyed-symlinks
78
+ - id: check-toml
79
+ types: [toml]
80
+ - id: check-yaml
81
+ types: [yaml]
82
+ - id: name-tests-test
83
+ args: [--django]
84
+ files: (^|/)tests/.+\.py$
85
+ - id: check-ast
86
+ types: [python]
87
+ - id: check-builtin-literals
88
+ types: [python]
89
+ - id: check-docstring-first
90
+ types: [python]
91
+ - id: debug-statements
92
+ types: [python]
93
+ - id: requirements-txt-fixer
94
+
95
+ # Tox
96
+ - repo: local
97
+ hooks:
98
+ - id: tox
99
+ name: Tox
100
+ entry: uv run tox
101
+ language: system
102
+ pass_filenames: false
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,31 @@
1
+ # pydalec CHANGELOG
2
+
3
+ ## v0.1.0 (20260603)
4
+
5
+ ### Added
6
+
7
+ - feat: Add `pydalec-test` TCP CLI
8
+ - feat: Add method to fetch current GNSS location
9
+ - feat: add acquiring location to CLI test script
10
+ - feat: Add method to fetch current sun zenith
11
+ - feat: Add diskwriter for incoming (TCP) data
12
+ - build: Add tox to pre-commit hooks
13
+ - feat: Add opt-in package debug logging
14
+
15
+ ### Changed
16
+
17
+ - build: improve __version__ tracking
18
+ - fix: `Transport.connected` is single source of truth for connection state
19
+ - refactor: rewrite measurement buffer handling
20
+ - refactor: Track measurements by object reference for efficient polling
21
+ - feat: CLI also reports current sun zenith
22
+ - feat: Add multiline `Measurement.__str__` format
23
+ - refactor: Move position/solar-zenith validity checks to Measurement properties
24
+ - build: Add Python 3.14 as tested and supported
25
+
26
+ ### Fixed
27
+
28
+ - fix: restart TCP reader on reconnect
29
+ - fix: use Windows-compliant filenames without colons
30
+
31
+ ### Removed