Skip to content

Commit a6f4b0a

Browse files
authored
Merge pull request #64 from CosmicStudioSoftware/igrf14
Updated package to use IGRF14
2 parents 7b06222 + 636e300 commit a6f4b0a

30 files changed

+1025
-180
lines changed

.github/workflows/docs.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ jobs:
2929
pip install -r test_requirements.txt
3030
pip install -r requirements.txt
3131
32-
- name: Set up pysat
33-
run: |
34-
mkdir pysatData
35-
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'"
36-
3732
- name: Check documentation build
3833
run: sphinx-build -E -b html docs dist/docs
3934

.github/workflows/main.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: ["ubuntu-latest", "windows-latest"]
19+
os: ["ubuntu-latest"]
2020
python-version: ["3.9", "3.10", "3.11", "3.12"]
2121
numpy_ver: ["latest"]
2222
include:
@@ -109,18 +109,23 @@ jobs:
109109
if: ${{ matrix.os != 'windows-latest' }}
110110
run: |
111111
rm -rf ./OMMBV
112-
cd ..
113-
coverage run -m pytest
112+
mkdir new_dir
113+
cd new_dir
114+
115+
coverage run -m pytest ../
114116
coverage report
115117
coverage xml
116-
mv coverage.xml ./OMMBV/.
118+
ls
119+
cp coverage.xml ../coverage.xml
120+
cat coverage.xml
117121
118122
- name: Run unit and integration tests on Windows
119123
if: ${{ matrix.os == 'windows-latest' }}
120124
run: |
121125
rm ./OMMBV -r -force
122126
cd ..
123-
coverage run -m pytest
127+
pytest ./OMMBV/tests -v --cov
128+
124129
coverage report
125130
coverage xml
126131
mv coverage.xml .\OMMBV\.
@@ -129,7 +134,7 @@ jobs:
129134
env:
130135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131136
COVERALLS_PARALLEL: true
132-
run: coveralls --rcfile=setup.cfg --service=github
137+
run: coveralls --service=github --verbose
133138

134139
finish:
135140
name: Finish Coverage Analysis
@@ -141,4 +146,4 @@ jobs:
141146
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142147
run: |
143148
pip install --upgrade coveralls
144-
coveralls --service=github --finish
149+
coveralls --service=github --finish --verbose

.readthedocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
# Required
66
version: 2
77

8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.10"
12+
13+
814
# Build documentation in the docs/ directory with Sphinx
915
sphinx:
1016
configuration: docs/conf.py
@@ -20,7 +26,6 @@ formats:
2026
# Optionally set the version of Python and requirements
2127
# required to build your docs
2228
python:
23-
version: 3.7
2429
install:
2530
- requirements: docs/requirements.txt
2631

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## [1.0.2] - ?????
5+
## [1.1.0] - ?????
66
- Switched away from distutils to Meson for build system
77
- Updated coupling to coveralls
88
- Updated package version for security issue in sphinx
9-
- Added online unit testing for Linux/MacOS/Windows
9+
- Added online unit testing for Linux and MacOS
10+
- Updated to IGRF14
1011

1112
## [1.0.1] - 2022-01-04
1213
- Added pyproject.toml to support systems without numpy.

CODE_OF_CONDUCT.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
In the interest of fostering an open and welcoming environment, we as
66
contributors and maintainers pledge to making participation in our project and
7-
our community a harassment-free experience for everyone, regardless of age, body
8-
size, disability, ethnicity, sex characteristics, gender identity and expression,
9-
level of experience, education, socio-economic status, nationality, personal
10-
appearance, race, religion, or sexual identity and orientation.
7+
our community a harassment-free experience for everyone, regardless of age,
8+
body size, disability, ethnicity, gender identity and expression, level of
9+
experience, nationality, personal appearance, race, religion, or sexual
10+
identity and orientation.
1111

1212
## Our Standards
1313

@@ -23,13 +23,13 @@ include:
2323
Examples of unacceptable behavior by participants include:
2424

2525
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
26+
advances
2727
* Trolling, insulting/derogatory comments, and personal or political attacks
2828
* Public or private harassment
2929
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
30+
address, without explicit permission
3131
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
32+
professional setting
3333

3434
## Our Responsibilities
3535

@@ -48,29 +48,35 @@ threatening, offensive, or harmful.
4848
This Code of Conduct applies both within project spaces and in public spaces
4949
when an individual is representing the project or its community. Examples of
5050
representing a project or community include using an official project e-mail
51-
address, posting via an official social media account, or acting as an appointed
52-
representative at an online or offline event. Representation of a project may be
53-
further defined and clarified by project maintainers.
51+
address, posting via an official social media account, or acting as an
52+
appointed representative at an online or offline event. Representation of a
53+
project may be further defined and clarified by project maintainers.
5454

5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at [email protected]. All
59-
complaints will be reviewed and investigated and will result in a response that
60-
is deemed necessary and appropriate to the circumstances. The project team is
61-
obligated to maintain confidentiality with regard to the reporter of an incident.
62-
Further details of specific enforcement policies may be posted separately.
58+
reported by contacting the project team at [email protected]. The
59+
pysat project team will review and investigate all complaints, and will respond
60+
in a way that it deems appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an
62+
incident. Further details of specific enforcement policies may be posted
63+
separately.
6364

6465
Project maintainers who do not follow or enforce the Code of Conduct in good
6566
faith may face temporary or permanent repercussions as determined by other
6667
members of the project's leadership.
6768

6869
## Attribution
6970

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
71+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
72+
version 1.4, available at
73+
[https://contributor-covenant.org/version/1/4][version]
7274

73-
[homepage]: https://www.contributor-covenant.org
75+
## FAQ
7476

7577
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
78+
[https://www.contributor-covenant.org/faq][faq]
79+
80+
[homepage]: https://contributor-covenant.org
81+
[version]: https://contributor-covenant.org/version/1/4/
82+
[faq]: https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 125 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,173 @@
11
Contributing
22
============
33

4-
Bug reports, feature suggestions and other contributions are greatly
5-
appreciated! Pysat is a community-driven project and welcomes both feedback and
6-
contributions.
4+
Bug reports, feature suggestions, and other contributions are greatly
5+
appreciated!
76

87
Short version
9-
=============
8+
-------------
9+
10+
* Submit bug reports, feature requests, and questions at
11+
[GitHub](https://github.com/CosmicStudioSoftware/OMMBV/issues)
1012

11-
* Submit bug reports and feature requests at `GitHub <https://github.com/rstoneback/OMMBV/issues>`_
1213
* Make pull requests to the ``develop`` branch
1314

15+
Issues
16+
------
17+
18+
Bug reports, questions, and feature requests should all be made as GitHub
19+
Issues. Templates are provided for each type of issue, to help you include
20+
all the necessary information.
21+
22+
Questions
23+
^^^^^^^^^
24+
25+
Not sure how something works? Ask away! The more information you provide, the
26+
easier the question will be to answer.
27+
1428
Bug reports
15-
===========
29+
^^^^^^^^^^^
1630

17-
When `reporting a bug <https://github.com/rstoneback/OMMBV/issues>`_ please
31+
When [reporting a bug](https://github.com/CosmicStudioSoftware/OMMBV/issues) please
1832
include:
1933

2034
* Your operating system name and version
35+
2136
* Any details about your local setup that might be helpful in troubleshooting
37+
2238
* Detailed steps to reproduce the bug
2339

2440
Feature requests and feedback
25-
=============================
41+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2642

27-
The best way to send feedback is to file an issue at
28-
`GitHub <https://github.com/rstoneback/OMMBV/issues>`_.
43+
The best way to send feedback is to file an
44+
[issue](https://github.com/CosmicStudioSoftware/OMMBV/issues).
2945

30-
If you are proposing a feature:
46+
If you are proposing a new feature or a change in something that already exists:
3147

3248
* Explain in detail how it would work.
49+
3350
* Keep the scope as narrow as possible, to make it easier to implement.
51+
3452
* Remember that this is a volunteer-driven project, and that code contributions
3553
are welcome :)
3654

3755
Development
38-
===========
56+
-----------
57+
58+
To set up `OMMBV` for local development:
3959

40-
To set up `pysat` for local development:
60+
1. [Fork OMMBV on GitHub](https://github.com/CosmicStudioSoftware/OMMBV/fork).
4161

42-
1. `Fork pysat on GitHub <https://github.com/rstoneback/OMMBV/fork>`_.
43-
2. Clone your fork locally::
62+
2. Clone your fork locally:
4463

45-
git clone [email protected]:your_name_here/pysatMagVect.git
64+
```
65+
git clone [email protected]:your_name_here/OMMBV.git
66+
```
4667

47-
3. Create a branch for local development::
68+
3. Create a branch for local development:
4869

70+
```
4971
git checkout -b name-of-your-bugfix-or-feature
72+
```
73+
74+
Now you can make your changes locally.
75+
5076

51-
Now you can make your changes locally. Tests should be added to the
52-
appropriately named file in ``OMMBV/tests``.
53-
5477
4. When you're done making changes, run all the checks to ensure that nothing
55-
is broken on your local system::
56-
57-
nosetests -vs pysatMagVect
78+
is broken on your local system, as well as check for flake8 compliance:
79+
80+
```
81+
pytest
82+
```
83+
84+
5. You should also check for flake8 style compliance:
85+
86+
```
87+
flake8 . --count --select=D,E,F,H,W --show-source --statistics
88+
```
5889

59-
5. Update/add documentation (in ``docs``), if relevant
90+
Note that pysat uses the `flake-docstrings` and `hacking` packages to ensure
91+
standards in docstring formatting.
6092

61-
5. Commit your changes and push your branch to GitHub::
93+
6. Update/add documentation (in ``docs``). Even if you don't think it's
94+
relevant, check to see if any existing examples have changed.
6295

63-
git add .
64-
git commit -m "Brief description of your changes"
65-
git push origin name-of-your-bugfix-or-feature
96+
7. Add your name to the .zenodo.json file as an author
97+
98+
8. Commit your changes:
99+
```
100+
git add .
101+
git commit -m "AAA: Brief description of your changes"
102+
```
103+
Where AAA is a standard shorthand for the type of change (e.g., BUG or DOC).
104+
`pysat` follows the [numpy development workflow](https://numpy.org/doc/stable/dev/development_workflow.html),
105+
see the discussion there for a full list of this shorthand notation.
106+
107+
9. Once you are happy with the local changes, push to GitHub:
108+
```
109+
git push origin name-of-your-bugfix-or-feature
110+
```
111+
Note that each push will trigger the Continuous Integration workflow.
112+
113+
10. Submit a pull request through the GitHub website. Pull requests should be
114+
made to the ``develop`` branch. Note that automated tests will be run on
115+
GitHub Actions, but these must be initialized by a member of the pysat team
116+
for first time contributors.
66117

67-
6. Submit a pull request through the GitHub website. Pull requests should be
68-
made to the ``develop`` branch.
69118

70119
Pull Request Guidelines
71120
-----------------------
72121

73122
If you need some code review or feedback while you're developing the code, just
74-
make a pull request.
123+
make a pull request. Pull requests should be made to the ``develop`` branch.
75124

76125
For merging, you should:
77126

78127
1. Include an example for use
79128
2. Add a note to ``CHANGELOG.md`` about the changes
80-
3. Ensure that all checks passed (current checks include Scrutinizer, Travis-CI,
81-
and Coveralls) [1]_
82-
83-
.. [1] If you don't have all the necessary Python versions available locally or
84-
have trouble building all the testing environments, you can rely on
85-
Travis to run the tests for each change you add in the pull request.
86-
Because testing here will delay tests by other developers, please ensure
87-
that the code passes all tests on your local system first.
129+
3. Update the author list in ``zenodo.json``, if applicable
130+
4. Ensure that all checks passed (current checks include GitHub Actions,
131+
Coveralls and ReadTheDocs)
132+
133+
If you don't have all the necessary Python versions available locally or have
134+
trouble building all the testing environments, you can rely on GitHub Actions to
135+
run the tests for each change you add in the pull request. Because testing here
136+
will delay tests by other developers, please ensure that the code passes all
137+
tests on your local system first.
138+
139+
140+
Project Style Guidelines
141+
------------------------
142+
143+
In general, OMMBV follows PEP8 and numpydoc guidelines. Pytest runs the unit
144+
and integration tests, flake8 checks for style, and sphinx-build performs
145+
documentation tests. However, there are certain additional style elements that
146+
have been adopted to ensure the project maintains a consistent coding style.
147+
These include:
148+
149+
* Line breaks should occur before a binary operator (ignoring flake8 W503)
150+
* Combine long strings using `join`
151+
* Preferably break long lines on open parentheses rather than using `\`
152+
* Use no more than 80 characters per line
153+
* Several dependent packages have common nicknames, including:
154+
* `import datetime as dt`
155+
* `import numpy as np`
156+
* `import pandas as pds`
157+
* `import xarray as xr`
158+
* When incrementing a timestamp, use `dt.timedelta` instead of `pds.DateOffset`
159+
when possible to reduce program runtime
160+
* All classes should have `__repr__` and `__str__` functions
161+
* Docstrings use `Note` instead of `Notes`
162+
* Try to avoid creating a try/except statement where except passes
163+
* Use setup_method (or setup_class) and teardown_method (or teardown_class) in
164+
test classes
165+
* Use pytest parametrize in test classes when appropriate
166+
* Provide testing class methods with informative failure statements and
167+
descriptive, one-line docstrings
168+
* Block and inline comments should use proper English grammar and punctuation
169+
with the exception of single sentences in a block, which may then omit the
170+
final period
171+
* When casting is necessary, use `np.int64` and `np.float64` to ensure operating
172+
system agnosticism
173+

OMMBV/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@
2424

2525
__all__ = ['igrf', 'fortran_coords', 'sources', 'satellite',
2626
'trace', 'trans', 'utils', 'vector', 'heritage']
27+
28+
print("OMMBV brought to you by Cosmic Studio.")

0 commit comments

Comments
 (0)