spherapy 0.2.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.
- spherapy-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yaml +74 -0
- spherapy-0.2.0/.github/ISSUE_TEMPLATE/config.yml +17 -0
- spherapy-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yaml +33 -0
- spherapy-0.2.0/.github/ISSUE_TEMPLATE/question.yaml +24 -0
- spherapy-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +27 -0
- spherapy-0.2.0/.github/workflows/pr.yml +74 -0
- spherapy-0.2.0/.github/workflows/release.yml +31 -0
- spherapy-0.2.0/.gitignore +93 -0
- spherapy-0.2.0/.pre-commit-config.yaml +10 -0
- spherapy-0.2.0/CHANGELOG.md +12 -0
- spherapy-0.2.0/CONTRIBUTING.md +125 -0
- spherapy-0.2.0/LICENSE.md +19 -0
- spherapy-0.2.0/PKG-INFO +211 -0
- spherapy-0.2.0/README.md +177 -0
- spherapy-0.2.0/docs/README.md +76 -0
- spherapy-0.2.0/docs/orbit.md +364 -0
- spherapy-0.2.0/docs/timespan.md +307 -0
- spherapy-0.2.0/docs/updater.md +102 -0
- spherapy-0.2.0/docs/util.celestrak.md +107 -0
- spherapy-0.2.0/docs/util.constants.md +45 -0
- spherapy-0.2.0/docs/util.credentials.md +109 -0
- spherapy-0.2.0/docs/util.elements_u.md +87 -0
- spherapy-0.2.0/docs/util.epoch_u.md +194 -0
- spherapy-0.2.0/docs/util.exceptions.md +36 -0
- spherapy-0.2.0/docs/util.md +16 -0
- spherapy-0.2.0/docs/util.orbital_u.md +111 -0
- spherapy-0.2.0/docs/util.spacetrack.md +152 -0
- spherapy-0.2.0/pyproject.toml +223 -0
- spherapy-0.2.0/setup.cfg +4 -0
- spherapy-0.2.0/spherapy/__init__.py +93 -0
- spherapy-0.2.0/spherapy/__main__.py +17 -0
- spherapy-0.2.0/spherapy/_version.py +34 -0
- spherapy-0.2.0/spherapy/data/TLEs/25544.tle +153378 -0
- spherapy-0.2.0/spherapy/orbit.py +874 -0
- spherapy-0.2.0/spherapy/timespan.py +436 -0
- spherapy-0.2.0/spherapy/updater.py +91 -0
- spherapy-0.2.0/spherapy/util/__init__.py +0 -0
- spherapy-0.2.0/spherapy/util/celestrak.py +87 -0
- spherapy-0.2.0/spherapy/util/constants.py +38 -0
- spherapy-0.2.0/spherapy/util/credentials.py +131 -0
- spherapy-0.2.0/spherapy/util/elements_u.py +70 -0
- spherapy-0.2.0/spherapy/util/epoch_u.py +149 -0
- spherapy-0.2.0/spherapy/util/exceptions.py +7 -0
- spherapy-0.2.0/spherapy/util/orbital_u.py +72 -0
- spherapy-0.2.0/spherapy/util/spacetrack.py +272 -0
- spherapy-0.2.0/spherapy.conf +8 -0
- spherapy-0.2.0/spherapy.egg-info/PKG-INFO +211 -0
- spherapy-0.2.0/spherapy.egg-info/SOURCES.txt +53 -0
- spherapy-0.2.0/spherapy.egg-info/dependency_links.txt +1 -0
- spherapy-0.2.0/spherapy.egg-info/entry_points.txt +3 -0
- spherapy-0.2.0/spherapy.egg-info/requires.txt +20 -0
- spherapy-0.2.0/spherapy.egg-info/top_level.txt +1 -0
- spherapy-0.2.0/tests/spherapy/test_orbit.py +565 -0
- spherapy-0.2.0/tests/spherapy/test_timespan.py +293 -0
- spherapy-0.2.0/tests/utils/test_epoch_u.py +103 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Create a new bug report.
|
|
3
|
+
title: '[Bug]: <title>'
|
|
4
|
+
labels: [type:bug]
|
|
5
|
+
body:
|
|
6
|
+
|
|
7
|
+
- type: checkboxes
|
|
8
|
+
attributes:
|
|
9
|
+
label: Is there an existing issue for this?
|
|
10
|
+
description: 'Please [search :mag: the issues](https://github.com/rzmearns/spherapy/issues) (open & closed) to check if this bug has already been reported.'
|
|
11
|
+
options:
|
|
12
|
+
- label: I have searched the existing issues
|
|
13
|
+
required: true
|
|
14
|
+
|
|
15
|
+
- type: input
|
|
16
|
+
attributes:
|
|
17
|
+
label: Spherapy Version
|
|
18
|
+
description: What spherapy version are you using?
|
|
19
|
+
placeholder: Output of `spherapy.__version__`
|
|
20
|
+
validations:
|
|
21
|
+
required: true
|
|
22
|
+
|
|
23
|
+
- type: checkboxes
|
|
24
|
+
attributes:
|
|
25
|
+
label: Is this issue reproducible using the latest spherapy version?
|
|
26
|
+
description: |
|
|
27
|
+
You can check the latest spherapy version number at [pypi-spherapy](https://pypi.org/project/spherapy/). If you are not up to date, please try to reproduce your issue after updating.
|
|
28
|
+
options:
|
|
29
|
+
- label: I confirm the issue is still reproducible with the latest version
|
|
30
|
+
|
|
31
|
+
- type: textarea
|
|
32
|
+
attributes:
|
|
33
|
+
label: Current Behaviour
|
|
34
|
+
description: Describe the problem you are experiencing. Screenshots are welcome. Please enclose copied code in ```.
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
|
|
38
|
+
- type: textarea
|
|
39
|
+
attributes:
|
|
40
|
+
label: Expected Behaviour
|
|
41
|
+
description: Describe what you expect to happen instead.
|
|
42
|
+
validations:
|
|
43
|
+
required: true
|
|
44
|
+
|
|
45
|
+
- type: textarea
|
|
46
|
+
attributes:
|
|
47
|
+
label: Environment Details
|
|
48
|
+
description: |
|
|
49
|
+
Please provide additional information about your environment; python version, etc.
|
|
50
|
+
|
|
51
|
+
:warning: _Remember to redact or remove any sensitive information!_
|
|
52
|
+
value: |
|
|
53
|
+
- Python version
|
|
54
|
+
- Are you running python in a virtual environment
|
|
55
|
+
- Are you using the default spherapy configuration or using a SPHERAPY_CONFIG_DIR:
|
|
56
|
+
- Are you using spacetrack credentials, or faling back to celestrak
|
|
57
|
+
- Last spherapy version(s) which did _not_ exhibit the problem:
|
|
58
|
+
|
|
59
|
+
- type: textarea
|
|
60
|
+
attributes:
|
|
61
|
+
label: Minimal Reproducible Example
|
|
62
|
+
description: |
|
|
63
|
+
Please provide [the smallest, complete code snippet](https://stackoverflow.com/help/minimal-reproducible-example) that spherapy's maintainers can run to reproduce the issue. An easy way to get started is to copy the examples in [README](https://github.com/rzmearns/spherapy/blob/main/README.md) and modify it accordingly. Failing this, any sort of reproduction steps are better than nothing!
|
|
64
|
+
validations:
|
|
65
|
+
required: true
|
|
66
|
+
|
|
67
|
+
- type: textarea
|
|
68
|
+
attributes:
|
|
69
|
+
label: Further Information
|
|
70
|
+
description: If needed, please provide additional information about your issue (attachments, links, references, etc.).
|
|
71
|
+
|
|
72
|
+
- type: markdown
|
|
73
|
+
attributes:
|
|
74
|
+
value: ':stop_sign: _Make sure you are reporting a problem with spherapy. For general questions, please ask a [question](https://github.com/rzmearns/spherapy/issues)_'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
issue_templates:
|
|
3
|
+
- name: "Question"
|
|
4
|
+
description: "Ask a questino"
|
|
5
|
+
title: "[Question]: "
|
|
6
|
+
labels: ["type:support"]
|
|
7
|
+
body: "./ISSUE_TEMPLATE/question.md"
|
|
8
|
+
- name: "Bug Report"
|
|
9
|
+
description: "Report a bug with spherapy"
|
|
10
|
+
title: "[Bug]: "
|
|
11
|
+
labels: ["type:bug"]
|
|
12
|
+
body: "./ISSUE_TEMPLATE/bug_report.md"
|
|
13
|
+
- name: "Feature Request"
|
|
14
|
+
description: "Request a new spherapy feature"
|
|
15
|
+
title: "[Feature]: "
|
|
16
|
+
labels: ["type:enhancement"]
|
|
17
|
+
body: "./ISSUE_TEMPLATE/feature_request.md"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Feature/Documentation Request
|
|
2
|
+
description: Suggest an idea for this project.
|
|
3
|
+
title: "[Feature]: <title>"
|
|
4
|
+
labels: [type:enhancement]
|
|
5
|
+
body:
|
|
6
|
+
|
|
7
|
+
- type: textarea
|
|
8
|
+
attributes:
|
|
9
|
+
label: Is your feature/documentation request related to a problem?
|
|
10
|
+
description: A clear and concise description of what the problem is. Eg. I'm always frustrated when [...].
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
|
|
14
|
+
- type: textarea
|
|
15
|
+
attributes:
|
|
16
|
+
label: Describe the solution you'd like.
|
|
17
|
+
description: A clear and concise description of what you want to happen.
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
|
|
21
|
+
- type: textarea
|
|
22
|
+
attributes:
|
|
23
|
+
label: Describe alternatives you've considered.
|
|
24
|
+
description: A clear and concise description of any alternative solutions or features you've considered.
|
|
25
|
+
validations:
|
|
26
|
+
required: false
|
|
27
|
+
|
|
28
|
+
- type: textarea
|
|
29
|
+
attributes:
|
|
30
|
+
label: Additional context
|
|
31
|
+
description: Add any other context or screenshots about the feature request here.
|
|
32
|
+
validations:
|
|
33
|
+
required: false
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Question
|
|
2
|
+
description: Create a new question.
|
|
3
|
+
title: '[Question]: <title>'
|
|
4
|
+
labels: [type:support]
|
|
5
|
+
body:
|
|
6
|
+
|
|
7
|
+
- type: checkboxes
|
|
8
|
+
attributes:
|
|
9
|
+
label: Is there an existing question for this?
|
|
10
|
+
description: 'Please [search :mag: the issues](https://github.com/rzmearns/spherapy/issues) to check if this question has already been asked.'
|
|
11
|
+
options:
|
|
12
|
+
- label: I have searched the existing issues
|
|
13
|
+
required: true
|
|
14
|
+
|
|
15
|
+
- type: textarea
|
|
16
|
+
attributes:
|
|
17
|
+
label: Question
|
|
18
|
+
description: What is your question?
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
|
|
22
|
+
- type: markdown
|
|
23
|
+
attributes:
|
|
24
|
+
value: ':stop_sign: _Make sure you are asking a question about spherapy. For reporting bugs, or requesting features, please submit an [issue](https://github.com/rzmearns/spherapy/issues)_'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## Proposed changes
|
|
2
|
+
|
|
3
|
+
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
|
|
4
|
+
|
|
5
|
+
## Types of changes
|
|
6
|
+
|
|
7
|
+
What types of changes does your code introduce to spherapy?
|
|
8
|
+
_Put an `x` in the boxes that apply_
|
|
9
|
+
|
|
10
|
+
- [ ] Bugfix (non-breaking change which fixes an issue)
|
|
11
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
12
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
13
|
+
- [ ] Documentation Update (modifying function documentation, or providing examples)
|
|
14
|
+
- [ ] Infrastructure Update (modifying tests, CI pipeline, etc.)
|
|
15
|
+
|
|
16
|
+
## Checklist
|
|
17
|
+
|
|
18
|
+
_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
|
|
19
|
+
|
|
20
|
+
- [ ] I have read the [Contributing Guide](https://github.com/rzmearns/spherapy/blob/main/CONTRIBUTING.md)
|
|
21
|
+
- [ ] Lint, typing, and unit tests pass locally with my changes
|
|
22
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
23
|
+
- [ ] I have added the necessary documentation
|
|
24
|
+
|
|
25
|
+
## Further comments
|
|
26
|
+
|
|
27
|
+
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: PR pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- 'main'
|
|
7
|
+
paths:
|
|
8
|
+
- '**.py'
|
|
9
|
+
- 'pyproject.toml'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
lint:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- run: echo "Running lint from merge of ${{ github.event.pull_request.head.ref }} on commit ${{ github.event.pull_request.head.sha }}"
|
|
16
|
+
- id: lint-checkout
|
|
17
|
+
name: Checkout
|
|
18
|
+
uses: actions/checkout@v5
|
|
19
|
+
- id: lint-install-python
|
|
20
|
+
name: Set up Python 3.12
|
|
21
|
+
uses: actions/setup-python@v6
|
|
22
|
+
with:
|
|
23
|
+
python-version: 3.12
|
|
24
|
+
cache: pip
|
|
25
|
+
- id: lint-install-dependencies
|
|
26
|
+
name: Install dependencies
|
|
27
|
+
run: pip install --editable .[dev]
|
|
28
|
+
- id: lint-run
|
|
29
|
+
run: ruff check
|
|
30
|
+
|
|
31
|
+
type:
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
steps:
|
|
34
|
+
- run: echo "Running static type analysis from merge of ${{ github.event.pull_request.head.ref }} on commit ${{ github.event.pull_request.head.sha }}"
|
|
35
|
+
- id: type-checkout
|
|
36
|
+
name: Checkout for Typing
|
|
37
|
+
uses: actions/checkout@v5
|
|
38
|
+
- id: type-install-python
|
|
39
|
+
name: Set up Python 3.12
|
|
40
|
+
uses: actions/setup-python@v6
|
|
41
|
+
with:
|
|
42
|
+
python-version: 3.12
|
|
43
|
+
cache: pip
|
|
44
|
+
- id: type-install-dependencies
|
|
45
|
+
name: Install dependencies for Typing
|
|
46
|
+
run: pip install --editable .[dev]
|
|
47
|
+
- id: type-run
|
|
48
|
+
run: mypy spherapy --disable-error-code=import-untyped
|
|
49
|
+
|
|
50
|
+
test:
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
strategy:
|
|
53
|
+
matrix:
|
|
54
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
55
|
+
steps:
|
|
56
|
+
- run: echo "Running tests from merge of ${{ github.event.pull_request.head.ref }} on commit ${{ github.event.pull_request.head.sha }}"
|
|
57
|
+
- id: checkout
|
|
58
|
+
name: Checkout
|
|
59
|
+
uses: actions/checkout@v5
|
|
60
|
+
- id: install-python
|
|
61
|
+
name: Set up Python ${{ matrix.python-version }}
|
|
62
|
+
uses: actions/setup-python@v6
|
|
63
|
+
with:
|
|
64
|
+
python-version: ${{ matrix.python-version }}
|
|
65
|
+
cache: pip
|
|
66
|
+
- id: install-dependencies
|
|
67
|
+
name: Install dependencies
|
|
68
|
+
run: pip install --editable .[dev]
|
|
69
|
+
- id: pytest-run
|
|
70
|
+
name: Running Pytest
|
|
71
|
+
run: |
|
|
72
|
+
export SPHERAPY_CONFIG_DIR="."
|
|
73
|
+
python -m pytest
|
|
74
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build-release:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- id: checkout
|
|
12
|
+
name: Checkout
|
|
13
|
+
uses: actions/checkout@v5
|
|
14
|
+
with:
|
|
15
|
+
fetch-depth: 0
|
|
16
|
+
- id: install-python
|
|
17
|
+
name: Set up Python 3.12
|
|
18
|
+
uses: actions/setup-python@v6
|
|
19
|
+
with:
|
|
20
|
+
python-version: 3.12
|
|
21
|
+
cache: pip
|
|
22
|
+
- id: install-dependencies
|
|
23
|
+
name: Install dependencies for Build
|
|
24
|
+
run: pip install build twine
|
|
25
|
+
- id: build-run
|
|
26
|
+
run: python -m build
|
|
27
|
+
- id: publish-run
|
|
28
|
+
env:
|
|
29
|
+
TWINE_USERNAME: __token__
|
|
30
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
31
|
+
run: python -m twine upload --verbose dist/*
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Specific Project Directories #
|
|
2
|
+
################################
|
|
3
|
+
data/spacetrack
|
|
4
|
+
data/TLEs
|
|
5
|
+
|
|
6
|
+
# Compiled source #
|
|
7
|
+
###################
|
|
8
|
+
*.pyc
|
|
9
|
+
*.vscode
|
|
10
|
+
build
|
|
11
|
+
|
|
12
|
+
# Environment #
|
|
13
|
+
############
|
|
14
|
+
env/
|
|
15
|
+
venv/
|
|
16
|
+
.venv/
|
|
17
|
+
spherapy-env/
|
|
18
|
+
|
|
19
|
+
# Packages #
|
|
20
|
+
############
|
|
21
|
+
# it's better to unpack these files and commit the raw source
|
|
22
|
+
# git has its own built in compression methods
|
|
23
|
+
*.7z
|
|
24
|
+
*.dmg
|
|
25
|
+
*.gz
|
|
26
|
+
*.iso
|
|
27
|
+
*.jar
|
|
28
|
+
*.rar
|
|
29
|
+
*.tar
|
|
30
|
+
*.zip
|
|
31
|
+
*.egg-info
|
|
32
|
+
|
|
33
|
+
# Logs and databases #
|
|
34
|
+
######################
|
|
35
|
+
*.log
|
|
36
|
+
*.out
|
|
37
|
+
*.sql
|
|
38
|
+
*.sqlite
|
|
39
|
+
*.json
|
|
40
|
+
*.console
|
|
41
|
+
*.bsp
|
|
42
|
+
|
|
43
|
+
# Caches #
|
|
44
|
+
######################
|
|
45
|
+
*__pycache__
|
|
46
|
+
*.pytest_cache
|
|
47
|
+
*.cache
|
|
48
|
+
*.tags*
|
|
49
|
+
*.ruff_cache
|
|
50
|
+
*.pytest_cache
|
|
51
|
+
*.mypy_cache
|
|
52
|
+
|
|
53
|
+
# OS generated files #
|
|
54
|
+
######################
|
|
55
|
+
.DS_Store
|
|
56
|
+
.DS_Store?
|
|
57
|
+
._*
|
|
58
|
+
.Spotlight-V100
|
|
59
|
+
.Trashes
|
|
60
|
+
ehthumbs.db
|
|
61
|
+
Thumbs.db
|
|
62
|
+
|
|
63
|
+
# Data files #
|
|
64
|
+
######################
|
|
65
|
+
*.dat
|
|
66
|
+
*.mat
|
|
67
|
+
*.npy
|
|
68
|
+
*.pickle
|
|
69
|
+
*.dbf
|
|
70
|
+
*.prj
|
|
71
|
+
*.shp
|
|
72
|
+
*.shx
|
|
73
|
+
*.cpg
|
|
74
|
+
*.html
|
|
75
|
+
*.txt
|
|
76
|
+
*.tle
|
|
77
|
+
*.temptle
|
|
78
|
+
|
|
79
|
+
# Backup files #
|
|
80
|
+
######################
|
|
81
|
+
*.m~
|
|
82
|
+
*.xls#
|
|
83
|
+
*.xlsx#
|
|
84
|
+
*.doc#
|
|
85
|
+
*.docx#
|
|
86
|
+
*.ppt#
|
|
87
|
+
*.csv#
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
*.csv
|
|
91
|
+
*.icloud
|
|
92
|
+
*.nc
|
|
93
|
+
*.nc4
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.12.3 # Ruff version.
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff-check # Run the linter.
|
|
6
|
+
args: [--config=pyproject.toml]
|
|
7
|
+
- repo: https://github.com/gitleaks/gitleaks
|
|
8
|
+
rev: v8.24.2
|
|
9
|
+
hooks:
|
|
10
|
+
- id: gitleaks
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
The change log should include
|
|
2
|
+
- theme of the upversion
|
|
3
|
+
- changes in API
|
|
4
|
+
- changes in model behaviour
|
|
5
|
+
|
|
6
|
+
# v0.2.0
|
|
7
|
+
- initial release to pypi
|
|
8
|
+
- timespan object
|
|
9
|
+
- orbit object
|
|
10
|
+
- orbit object creation from: TLE, propagated orbital parameters, analytical orbital parameters, list of positions
|
|
11
|
+
- TLE updater, pulls requested TLEs from spacetrack, stores all TLEs for that satellite in a saved file
|
|
12
|
+
- TLE updater falls back to celestrak if no credentials provided
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Contribution Guide
|
|
2
|
+
|
|
3
|
+
## How to Contribute
|
|
4
|
+
Almost all communication with the spherapy maintainers should be done through the main spherapy Github repository: https://github.com/rzmearns/spherapy
|
|
5
|
+
|
|
6
|
+
- Bug reports and feature requests can be submitted through the [Issues](https://github.com/rzmearns/spherapy/issues) page on the repository. It is critical that sufficient information is provided in the bug report to recreate the problem. Please provide:
|
|
7
|
+
- The spherapy version
|
|
8
|
+
- The python version
|
|
9
|
+
- A description of the behaviour.
|
|
10
|
+
- The TLE files which resulted in the bug
|
|
11
|
+
- The timespan settings
|
|
12
|
+
|
|
13
|
+
- Any changes to actual code, including documentation, should be submitted as a pull request on Github.
|
|
14
|
+
- Please make sure to submit pull requests using a new branch following the [Branch Naming Convention](#branch-naming-convention). Don’t be afraid to create a pull request as soon as the branch is created. It can be always be updated later. Creating them early gives maintainers a chance to provide an early review of your code if that’s something you’re looking for. See below for more information on writing documentation and checking your changes.
|
|
15
|
+
- Make sure you understand the overall architecture of spherapy before adding features.
|
|
16
|
+
|
|
17
|
+
- No matter how you contribute, spherapy maintainers will try their best to read, research, and respond to your query as soon as possible. For code changes, automated checks and tests will run on Github to provide an initial “review” of your changes.
|
|
18
|
+
|
|
19
|
+
## Submitting Bugs
|
|
20
|
+
Please submit problems or bugs as issues in github, they will be tagged by a maintainer as a `bug`
|
|
21
|
+
|
|
22
|
+
https://github.com/rzmearns/spherapy/issues
|
|
23
|
+
|
|
24
|
+
## Submitting Feature Ideas
|
|
25
|
+
Please submit feature ideas as an issue in Github, they will be tagged by a maintainer as an `enhancement`
|
|
26
|
+
|
|
27
|
+
https://github.com/rzmearns/spherapy/issues
|
|
28
|
+
|
|
29
|
+
## Asking Questions
|
|
30
|
+
Please submit questions as an issue in Github, they will be tagged by a maintainer as `support`
|
|
31
|
+
|
|
32
|
+
https://github.com/rzmearns/spherapy/issues
|
|
33
|
+
|
|
34
|
+
## Adding Features
|
|
35
|
+
If you have a contribution to make to spherapy, please clone the repo, and submit a pull request.
|
|
36
|
+
In order to be considered for merging, the branch must pass the [Linting](#linting), [Testing](#testing) and [Static Typing](#typing) stages of the CI pipeline.
|
|
37
|
+
For any branch you make, please follow the following branch naming conventions:
|
|
38
|
+
|
|
39
|
+
### Branch Naming Convention
|
|
40
|
+
- If a branch is adding a feature to spherapy: `feature/{descriptive_name}`
|
|
41
|
+
- the feature must be supported by unit tests included in the branch
|
|
42
|
+
- will results in a minor upversion
|
|
43
|
+
- If a branch is fixing a spherapy bug: `bugfix/{descriptive_name}` or `bugfix/{ISSUE#}`
|
|
44
|
+
- the bugfix must be supported by regrestion tests included in the branch
|
|
45
|
+
- will result in a patch upversion
|
|
46
|
+
- If a branch is modifying or fixing a bug in the infrastructure (CI, etc.): `infrastucture/{descriptive_name}` or `infrastructure/{ISSUE#}`
|
|
47
|
+
- If a branch is updating the documentation: `docs/{descriptive_name}`
|
|
48
|
+
- The maintainers may use `hotfix/{descriptive_name}` or `hotfix/{ISSUE#}` if an urgent fix is required to the main branch
|
|
49
|
+
- will result in a patch upversion
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Development Environment
|
|
53
|
+
It is recommended that you setup a virtual environment running python 3.12 (spherapy is compatible with 3.10->3.12), and install the packages required within that virtual environment.
|
|
54
|
+
|
|
55
|
+
### Virtual Environment
|
|
56
|
+
```
|
|
57
|
+
pip install virtualenv
|
|
58
|
+
virtualenv -p=`which python3.12` .venv312
|
|
59
|
+
source .venv312/bin/activate
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Clone and install spherapy
|
|
63
|
+
```
|
|
64
|
+
git clone git@github.com:rzmearns/spherapy.git
|
|
65
|
+
pip install --editable .[dev]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Linting
|
|
69
|
+
Linting is acheived using Ruff. The necessary packages will be installed as part of the \[dev\] depenedencies.
|
|
70
|
+
Spherapy has an extensive list of linter warnings enabled by default, the full list can be found in the pyproject.toml under [tool.ruff.lint], while the explanation to each class of error, and specific errors can be found on Ruff's website, [Rules](https://docs.astral.sh/ruff/rules/)
|
|
71
|
+
|
|
72
|
+
If there is a good reason, individual linting errors can be excluded, but not entire error classes.
|
|
73
|
+
|
|
74
|
+
For coding style guidelines, see [Coding Style](#coding-style)
|
|
75
|
+
|
|
76
|
+
linting can be run locally using
|
|
77
|
+
```
|
|
78
|
+
ruff check
|
|
79
|
+
```
|
|
80
|
+
Tedious changes, for example sorting the import blocks, can be handled automatically by Ruff:
|
|
81
|
+
```
|
|
82
|
+
ruff check --fix
|
|
83
|
+
```
|
|
84
|
+
Linting will be automatically run whenever a commit is made to a pull request.
|
|
85
|
+
|
|
86
|
+
### Testing
|
|
87
|
+
Testing is achieved with pytest and pytest-check. The necessary packages will be installed as part of the \[dev\] depenedencies.
|
|
88
|
+
Tests should be located in the `tests/` dir, following a similar structure to the package structure.
|
|
89
|
+
If you add functionality to spherapy, there should be dedicated unit tests for each feature. If you contribute by fixing a bug, tests should be added to ensure that the bug does not get reintroduced in future merges. These regression tests should have a comment note detailing what they are protecting against.
|
|
90
|
+
|
|
91
|
+
spherapy often uses pytest-check to run all tests in a function in parallel, so that any one failure does not stop other tests in that function from running.
|
|
92
|
+
|
|
93
|
+
tests can be run locally using
|
|
94
|
+
```
|
|
95
|
+
pytest
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Tests will be automatically run whenever a commit is made to a pull request. (The tests will run under python3.10, python3.11 and python3.12)
|
|
99
|
+
|
|
100
|
+
### Typing
|
|
101
|
+
spherapy employs static type analysis using mypy (hopefully this will be changed to ty in the future). The necessary packages will be installed as part of the \[dev\] depenedencies.
|
|
102
|
+
|
|
103
|
+
Static typing can be run locally using
|
|
104
|
+
```
|
|
105
|
+
mypy spherapy --disable-error-code=import-untyped
|
|
106
|
+
```
|
|
107
|
+
The `--disable-error-code=import-untyped` flag is necessary to avoid errors with untyped libraries like astropy.
|
|
108
|
+
|
|
109
|
+
Static typing will be automatically run whenever a commit is made to a pull request.
|
|
110
|
+
|
|
111
|
+
### pre-commit hooks
|
|
112
|
+
Although not necessary, it is recommended to use [pre-commit](https://pre-commit.com/). The necessary packages will be installed as part of the \[dev\] depenedencies.
|
|
113
|
+
This runs configured checks on the codebase prior to every commit. The configured checks can be seen in [.pre-commit-config.yaml](https://github.com/rzmearns/spherapy/blob/main/.pre-commit-config.yaml)
|
|
114
|
+
The configured checks for spherapy are:
|
|
115
|
+
- `ruff check`
|
|
116
|
+
- `gitleaks`
|
|
117
|
+
|
|
118
|
+
To configure pre-commit, after `pip install .[dev]`, run `pre-commit install`
|
|
119
|
+
|
|
120
|
+
## Coding Style
|
|
121
|
+
In general, spherapy follows a modified PEP 8 style guidelines, that are enforced by the linter. The notable differences are:
|
|
122
|
+
- all indentations are TABS (NOT SPACES.)
|
|
123
|
+
- variables are snake_case (this_is_a_variable) (like PEP8)
|
|
124
|
+
- functions are mixedCase (thisIsAFunction)
|
|
125
|
+
- if there is an acronym in the function name, it should be in UPPERCASE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright © 2025 Robert Mearns
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|