majis-ops 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.
Files changed (53) hide show
  1. majis_ops-1.0.0/.gitignore +145 -0
  2. majis_ops-1.0.0/.gitlab-ci.yml +180 -0
  3. majis_ops-1.0.0/.readthedocs.yaml +22 -0
  4. majis_ops-1.0.0/.vscode/settings.json +20 -0
  5. majis_ops-1.0.0/CHANGELOG.md +21 -0
  6. majis_ops-1.0.0/DEV/ITL_10042024_AbsoluteTime_All.txt +1109 -0
  7. majis_ops-1.0.0/DEV/ITL_EARTH_23052024.csv +20 -0
  8. majis_ops-1.0.0/DEV/ITL_EARTH_23052024.txt +113 -0
  9. majis_ops-1.0.0/DEV/ITL_reader.ipynb +2656 -0
  10. majis_ops-1.0.0/DEV/issues/2-XLSM_template.ipynb +2011 -0
  11. majis_ops-1.0.0/DEV/issues/foo.xlsm +0 -0
  12. majis_ops-1.0.0/DEV/issues/timeline.xltm +0 -0
  13. majis_ops-1.0.0/LICENSE.md +29 -0
  14. majis_ops-1.0.0/PKG-INFO +242 -0
  15. majis_ops-1.0.0/README.md +218 -0
  16. majis_ops-1.0.0/docs/CHANGELOG.md +1 -0
  17. majis_ops-1.0.0/docs/_config.yml +61 -0
  18. majis_ops-1.0.0/docs/_toc.yml +32 -0
  19. majis_ops-1.0.0/docs/api/itl.md +15 -0
  20. majis_ops-1.0.0/docs/api/majis.md +7 -0
  21. majis_ops-1.0.0/docs/api/misc.md +13 -0
  22. majis_ops-1.0.0/docs/cli/itl.md +83 -0
  23. majis_ops-1.0.0/docs/contribute.md +32 -0
  24. majis_ops-1.0.0/docs/images/DEV_logo-square.svg +113 -0
  25. majis_ops-1.0.0/docs/images/favicon.ico +0 -0
  26. majis_ops-1.0.0/docs/images/logo-square.svg +86 -0
  27. majis_ops-1.0.0/docs/images/logo-wide.svg +91 -0
  28. majis_ops-1.0.0/docs/index.md +96 -0
  29. majis_ops-1.0.0/docs/notebooks/.gitignore +4 -0
  30. majis_ops-1.0.0/docs/notebooks/absolute_time.itl +1 -0
  31. majis_ops-1.0.0/docs/notebooks/events.evf +1 -0
  32. majis_ops-1.0.0/docs/notebooks/itl.ipynb +476 -0
  33. majis_ops-1.0.0/docs/notebooks/new_timeline_from_itl.xlsm +0 -0
  34. majis_ops-1.0.0/docs/notebooks/output.csv +3 -0
  35. majis_ops-1.0.0/docs/notebooks/output.itl +24 -0
  36. majis_ops-1.0.0/docs/notebooks/output.xlsm +0 -0
  37. majis_ops-1.0.0/docs/notebooks/relative_time.itl +1 -0
  38. majis_ops-1.0.0/docs/notebooks/timeline.ipynb +2002 -0
  39. majis_ops-1.0.0/docs/notebooks/timeline.xlsm +0 -0
  40. majis_ops-1.0.0/pyproject.toml +169 -0
  41. majis_ops-1.0.0/src/majis/__init__.py +10 -0
  42. majis_ops-1.0.0/src/majis/__version__.py +3 -0
  43. majis_ops-1.0.0/src/majis/itl/__init__.py +13 -0
  44. majis_ops-1.0.0/src/majis/itl/cli.py +148 -0
  45. majis_ops-1.0.0/src/majis/itl/export.py +110 -0
  46. majis_ops-1.0.0/src/majis/itl/reader.py +92 -0
  47. majis_ops-1.0.0/src/majis/itl/timeline.py +300 -0
  48. majis_ops-1.0.0/src/majis/itl/timeline.xltm +0 -0
  49. majis_ops-1.0.0/src/majis/misc/__init__.py +12 -0
  50. majis_ops-1.0.0/src/majis/misc/csv.py +110 -0
  51. majis_ops-1.0.0/src/majis/misc/events.py +67 -0
  52. majis_ops-1.0.0/src/majis/misc/evf.py +56 -0
  53. majis_ops-1.0.0/src/majis/misc/time.py +79 -0
@@ -0,0 +1,145 @@
1
+
2
+ # Created by https://www.toptal.com/developers/gitignore/api/python
3
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python
4
+
5
+ ### Python ###
6
+ # Byte-compiled / optimized / DLL files
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ pip-wheel-metadata/
29
+ share/python-wheels/
30
+ *.egg-info/
31
+ .installed.cfg
32
+ *.egg
33
+ MANIFEST
34
+
35
+ # PyInstaller
36
+ # Usually these files are written by a python script from a template
37
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
38
+ *.manifest
39
+ *.spec
40
+
41
+ # Installer logs
42
+ pip-log.txt
43
+ pip-delete-this-directory.txt
44
+
45
+ # Unit test / coverage reports
46
+ htmlcov/
47
+ .tox/
48
+ .nox/
49
+ .coverage
50
+ .coverage.*
51
+ .cache
52
+ nosetests.xml
53
+ coverage.xml
54
+ *.cover
55
+ *.py,cover
56
+ .hypothesis/
57
+ .pytest_cache/
58
+ pytestdebug.log
59
+
60
+ # Translations
61
+ *.mo
62
+ *.pot
63
+
64
+ # Django stuff:
65
+ *.log
66
+ local_settings.py
67
+ db.sqlite3
68
+ db.sqlite3-journal
69
+
70
+ # Flask stuff:
71
+ instance/
72
+ .webassets-cache
73
+
74
+ # Scrapy stuff:
75
+ .scrapy
76
+
77
+ # Sphinx documentation
78
+ docs/_build/
79
+ doc/_build/
80
+
81
+ # PyBuilder
82
+ target/
83
+
84
+ # Jupyter Notebook
85
+ .ipynb_checkpoints
86
+
87
+ # IPython
88
+ profile_default/
89
+ ipython_config.py
90
+
91
+ # pyenv
92
+ .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
102
+ __pypackages__/
103
+
104
+ # Celery stuff
105
+ celerybeat-schedule
106
+ celerybeat.pid
107
+
108
+ # SageMath parsed files
109
+ *.sage.py
110
+
111
+ # Environments
112
+ .env
113
+ .venv
114
+ env/
115
+ venv/
116
+ ENV/
117
+ env.bak/
118
+ venv.bak/
119
+ pythonenv*
120
+
121
+ # Spyder project settings
122
+ .spyderproject
123
+ .spyproject
124
+
125
+ # Rope project settings
126
+ .ropeproject
127
+
128
+ # mkdocs documentation
129
+ /site
130
+
131
+ # mypy
132
+ .mypy_cache/
133
+ .dmypy.json
134
+ dmypy.json
135
+
136
+ # Pyre type checker
137
+ .pyre/
138
+
139
+ # pytype static type analyzer
140
+ .pytype/
141
+
142
+ # profiling data
143
+ .prof
144
+
145
+ # End of https://www.toptal.com/developers/gitignore/api/python
@@ -0,0 +1,180 @@
1
+ image: python:3.10
2
+
3
+ stages:
4
+ - linter
5
+ - tests
6
+ - deploy
7
+
8
+ # Rules aliases
9
+ .rules_py_changes: &rules_py_changes
10
+ rules:
11
+ - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
12
+ - if: '$CI_MERGE_REQUEST_ID'
13
+ changes:
14
+ - src/**/*.py
15
+ - tests/**/*.py
16
+ - .gitlab-ci.yml
17
+
18
+ .rules_py_changes_no_mr_draft: &rules_py_changes_no_mr_draft
19
+ rules:
20
+ - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
21
+ - if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TITLE !~ /^Draft:/'
22
+ changes:
23
+ - src/**/*.py
24
+ - tests/**/*.py
25
+ - .gitlab-ci.yml
26
+
27
+ .rules_docs_changes: &rules_docs_changes
28
+ rules:
29
+ - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
30
+ - if: '$CI_MERGE_REQUEST_ID'
31
+ changes:
32
+ - docs/**/*
33
+ - .gitlab-ci.yml
34
+
35
+ .rules_version_changes: &rules_version_changes
36
+ rules:
37
+ - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
38
+ changes:
39
+ - src/majis/__version__.py
40
+
41
+ # Cache configuration
42
+ variables:
43
+ PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
44
+
45
+ cache:
46
+ key: "${CI_JOB_NAME}"
47
+ paths:
48
+ - .cache/pip
49
+ - .venv
50
+
51
+ # Install Hatch by default
52
+ default:
53
+ before_script:
54
+ - python -m pip install "hatch>=1.12"
55
+
56
+ # Linter
57
+ Ruff:
58
+ stage: linter
59
+ <<: *rules_py_changes
60
+ script:
61
+ - hatch -e linter run check
62
+ - hatch -e linter run format
63
+
64
+ # Tests
65
+ .pytest: &pytest
66
+ stage: tests
67
+ script:
68
+ - hatch -e tests run tests
69
+ --cov-report xml:coverage.xml
70
+ --junitxml=report.xml
71
+ coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+\%)$/'
72
+ artifacts:
73
+ expire_in: 1 week
74
+ reports:
75
+ junit: report.xml
76
+ coverage_report:
77
+ coverage_format: cobertura
78
+ path: coverage.xml
79
+
80
+ Pytest 3.10:
81
+ <<: *rules_py_changes
82
+ <<: *pytest
83
+
84
+ Pytest 3.11:
85
+ image: python:3.11
86
+ <<: *rules_py_changes_no_mr_draft
87
+ <<: *pytest
88
+
89
+ Pytest 3.12:
90
+ image: python:3.12
91
+ <<: *rules_py_changes_no_mr_draft
92
+ <<: *pytest
93
+
94
+ # Build docs
95
+ Docs:
96
+ stage: tests
97
+ <<: *rules_docs_changes
98
+ script:
99
+ - hatch -e docs run build
100
+
101
+ # Deployment
102
+ ReadTheDocs:
103
+ stage: deploy
104
+ rules:
105
+ - if: '$CI_COMMIT_TAG =~ /^(v|V)?(\d+)(\.\d+)+?$/ && $RTD_URL && $RTD_TOKEN'
106
+ - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $RTD_URL && $RTD_TOKEN'
107
+ cache: {}
108
+ before_script: []
109
+ script:
110
+ - curl -X POST -d "branches=$CI_COMMIT_REF_NAME" -d "token=$RTD_TOKEN" $RTD_URL
111
+ environment:
112
+ name: ReadTheDocs
113
+ url: https://majis-ops.readthedocs.io/en/$CI_COMMIT_REF_NAME
114
+
115
+ PyPI:
116
+ stage: deploy
117
+ rules:
118
+ - if: '$CI_COMMIT_TAG =~ /^(v|V)?(\d+)(\.\d+)+?$/ && $PYPI_TOKEN'
119
+ variables:
120
+ HATCH_INDEX_USER: __token__
121
+ HATCH_INDEX_AUTH: $PYPI_TOKEN
122
+ script:
123
+ - hatch publish
124
+ environment:
125
+ name: PyPI
126
+ url: https://pypi.org/project/majis-ops/
127
+
128
+ SWH:
129
+ stage: deploy
130
+ rules:
131
+ - if: '$CI_COMMIT_TAG =~ /^(v|V)?(\d+)(\.\d+)+?$/'
132
+ cache: {}
133
+ before_script: []
134
+ script:
135
+ - curl -X POST https://archive.softwareheritage.org/api/1/origin/save/git/url/${CI_PROJECT_URL}/
136
+ environment:
137
+ name: Software Heritage
138
+ url: https://archive.softwareheritage.org/browse/origin/?origin_url=${CI_PROJECT_URL}
139
+
140
+ # Release
141
+ Prepare release:
142
+ stage: deploy
143
+ <<: *rules_version_changes
144
+ script:
145
+ - echo "VERSION=$(hatch version)" > variables.env
146
+ - echo "DATE=$(date +'%Y/%m/%d')" >> variables.env
147
+ - awk "/releases/{found=1;next}found" CHANGELOG.md | awk "/\[Release/{exit}1" > Release_description.md
148
+ artifacts:
149
+ paths:
150
+ - Release_description.md
151
+ reports:
152
+ dotenv: variables.env
153
+
154
+ Publish release:
155
+ image: registry.gitlab.com/gitlab-org/release-cli:latest
156
+ stage: deploy
157
+ <<: *rules_version_changes
158
+ needs:
159
+ - job: 'Prepare release'
160
+ artifacts: true
161
+ cache: {}
162
+ before_script: []
163
+ script:
164
+ - echo "Version ${VERSION} - ${DATE}"
165
+ - cat ./Release_description.md
166
+ release:
167
+ name: 'Version ${VERSION} - ${DATE}'
168
+ description: ./Release_description.md
169
+ tag_name: ${VERSION}
170
+ tag_message: 'Version ${VERSION} - ${DATE}'
171
+ ref: '$CI_COMMIT_SHA'
172
+ assets:
173
+ links:
174
+ - name: 'PyPI'
175
+ url: 'https://pypi.org/project/majis-ops/${VERSION}/'
176
+ link_type: package
177
+ - name: 'Documentation'
178
+ url: 'https://majis-ops.readthedocs.io/en/${VERSION}'
179
+ - name: 'Software Heritage'
180
+ url: 'https://archive.softwareheritage.org/browse/origin/directory/?origin_url=${CI_PROJECT_URL}&release=${VERSION}'
@@ -0,0 +1,22 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-22.04
5
+ tools:
6
+ python: "3.10"
7
+ jobs:
8
+ pre_build:
9
+ - pip install jupyter-book
10
+ - jupyter-book config sphinx docs/
11
+
12
+ python:
13
+ install:
14
+ - method: pip
15
+ path: .
16
+
17
+ sphinx:
18
+ builder: html
19
+ fail_on_warning: true
20
+
21
+ formats:
22
+ - pdf
@@ -0,0 +1,20 @@
1
+ {
2
+ "python.testing.pytestArgs": [
3
+ "tests",
4
+ "--no-cov",
5
+ "-vv",
6
+ "--color=no"
7
+ ],
8
+ "python.testing.unittestEnabled": false,
9
+ "python.testing.pytestEnabled": true,
10
+ "cSpell.words": [
11
+ "funcs",
12
+ "maxsplit",
13
+ "openpyxl",
14
+ "perijove",
15
+ "Poulet",
16
+ "xtlm"
17
+ ],
18
+ "liveServer.settings.root": "docs/_build/html",
19
+ "python.testing.pytestPath": ".venv/tests/bin/pytest"
20
+ }
@@ -0,0 +1,21 @@
1
+ # MAJIS operations toolbox history
2
+
3
+ All notable changes to MAJIS operations toolbox will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ [Unreleased][new]
8
+ -----------------
9
+ [new]: https://git.ias.u-psud.fr/majis_sgs/operations/majis-ops-toolbox/-/compare/1.0.0...main
10
+
11
+
12
+ [Release 1.0.0 - 2024/06/19][1.0.0]
13
+ -----------------------------------
14
+ [1.0.0]: https://juigitlab.esac.esa.int/python/planetary-coverage/-/releases/1.0.0
15
+
16
+ ### Added
17
+
18
+ - Add `read_itl()`, `save_itl()`, `save_csv()` and `save_xlsm()` methods.
19
+ - Add `Timeline` object to manipulate MAJIS `.xlsm` timeline file.
20
+ - Add `majis-itl` command line interface.
21
+ - Project init