Skip to content

Commit

Permalink
Merge pull request #41 from pysat/main
Browse files Browse the repository at this point in the history
Pull changes back into develop
  • Loading branch information
jklenzing authored Nov 30, 2022
2 parents ec9b495 + 0d0d0fa commit eaaa239
Show file tree
Hide file tree
Showing 22 changed files with 372 additions and 143 deletions.
27 changes: 12 additions & 15 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
labels: bug
title: "BUG: "

---

**Describe the bug**
A clear and concise description of what the bug is.
# Description
A clear and concise description of what the bug is, including a description
of what you expected the outcome to be.

**To Reproduce**
# To Reproduce this bug:
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.
Consider including images or test files to help others reproduce the bug and
solve the problem.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 22]
## Test configuration
- OS: [e.g. Hal]
- Version [e.g. Python 3.47]
- Other details about your setup that could be relevant

**Additional context**
# Additional context
Add any other context about the problem here.
27 changes: 17 additions & 10 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
title: "ENH: "
labels: enhancement

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
# Description
A clear and concise description of the new feature or behaviour you would like.

**Describe the solution you'd like**
## Potential impact

- Is the feature related to an existing problem?
- How critical is this feature to your workflow?
- How wide of an impact to you anticipate this enhancement having?
- Would this break any existing functionality?

## Potential solution(s)
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
# Alternatives
A clear description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
# Additional context
Add any other context or screenshots about the feature request here, potentially
including your operational configuration.
3 changes: 1 addition & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7]
python-version: ["3.9"]

name: Documentation tests
steps:
Expand All @@ -24,7 +24,6 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test_requirements.txt
pip install -r requirements.txt
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test_requirements.txt
pip install -r requirements.txt
Expand Down
10 changes: 10 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
{
"affiliation": "Predictive Science",
"name": "Pembroke, Asher"
},
{
"affiliation": "The Johns Hopkins Applied Physics Laboratory",
"name": "Starr, Greg",
"orcid": "0000-0002-3487-3630"
},
{
"affiliation": "SRI International",
"name": "Reimer, Ashton",
"orcid": "0000-0002-4621-3453"
}
]
}
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

[0.4.0] - 2022-XX-XX
[0.3.2] - 2022-05-13
--------------------
* New Features
* Compatible with pysat v3.0+
* Deprecations
* Documentation
* Added pull request templates and other GitHub project documentation.
* Switched Windows installation instructions to favor installing WSL.
* Bug Fix
* Improved builds for newer compilers.
* Replaces uninterpretable characters with '*' so data loading may continue.
* Maintenance
* Adopted latest pysat development standards.
* Shifted from TravisCI to GitHub Actions for online testing.
* Adopted setup.cfg
* Improved PEP8 compliance

146 changes: 146 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
Contributing
============

Bug reports, feature suggestions and other contributions are greatly
appreciated! pysatCDF is a community-driven project and welcomes both
feedback and contributions.

Come join us on Slack! An invitation to the pysat workspace is available
in the 'About' section of the
[pysat GitHub Repository.](https://github.com/pysat/pysat) Development meetings
are generally held fortnightly.

Short version
-------------

* Submit bug reports and feature requests at [GitHub](https://github.com/pysat/pysatCDF/issues)
* Make pull requests to the ``develop`` branch

Bug reports
-----------

When [reporting a bug](https://github.com/pysat/pysatCDF/issues) please
include:

* Your operating system name and version
* Any details about your local setup that might be helpful in troubleshooting
* Detailed steps to reproduce the bug

Feature requests and feedback
-----------------------------

The best way to send feedback is to file an issue at
[GitHub](https://github.com/pysat/pysatCDF/issues).

If you are proposing a feature:

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

Development
-----------

To set up `pysatCDF` for local development:

1. [Fork pysat on GitHub](https://github.com/pysat/pysatCDF/fork).

2. Clone your fork locally:
```
git clone git@github.com:your_name_here/pysatCDF.git
```

3. Create a branch for local development:
```
git checkout -b name-of-your-bugfix-or-feature
```

Now you can make your changes locally. Tests for new instruments are
performed automatically. Tests for custom functions should be added to
the appropriately named file in ``pysatCDF/tests``. If no test
file exists, then you should create one. This testing uses pytest, which
will run tests on any python file in the test directory that starts with
``test_``.

4. When you're done making changes, run all the checks to ensure that nothing
is broken on your local system:
```
pytest -vs
```

5. Update/add documentation (in ``docs``), if relevant

6. Add your name to the .zenodo.json file as an author

7. Commit your changes:
```
git add .
git commit -m "AAA: Brief description of your changes"
```
Where AAA is a standard shorthand for the type of change (eg, BUG or DOC).
`pysat` follows the [numpy development workflow](https://numpy.org/doc/stable/dev/development_workflow.html),
see the discussion there for a full list of this shorthand notation.

8. Once you are happy with the local changes, push to Github:
```
git push origin name-of-your-bugfix-or-feature
```
Note that each push will trigger the Continuous Integration workflow.

9. Submit a pull request through the GitHub website. Pull requests should be
made to the ``develop`` branch.

Pull Request Guidelines
-----------------------

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

For merging, you should:

1. Include an example for use
2. Add a note to ``CHANGELOG.md`` about the changes
3. Ensure that all checks passed (current checks include GitHub Actions
and Coveralls)

If you don't have all the necessary Python versions available locally or
have trouble building all the testing environments, you can rely on
the project's Continuous Integration (CI) service to run the tests for each change you add in the pull
request. Because testing here will delay tests by other developers,
please ensure that the code passes all tests on your local system first.

Project Style Guidelines
^^^^^^^^^^^^^^^^^^^^^^^^

In general, pysat follows PEP8 and numpydoc guidelines. Pytest runs the unit
and integration tests, flake8 checks for style, and sphinx-build performs
documentation tests. However, there are certain additional style elements that
have been settled on to ensure the project maintains a consistent coding style.
These include:

* Line breaks should occur before a binary operator (ignoring flake8 W503)
* Combine long strings using `join`
* Preferably break long lines on open parentheses rather than using `\`
* Use no more than 80 characters per line
* Avoid using Instrument class key attribute names as unrelated variable names:
`platform`, `name`, `tag`, and `inst_id`
* The pysat logger is imported into each sub-module and provides status updates
at the info and warning levels (as appropriate)
* Several dependent packages have common nicknames, including:
* `import datetime as dt`
* `import numpy as np`
* `import pandas as pds`
* `import xarray as xr`
* All classes should have `__repr__` and `__str__` functions
* Docstrings use `Note` instead of `Notes`
* Try to avoid creating a try/except statement where except passes
* Use setup and teardown in test classes
* Use pytest parametrize in test classes when appropriate
* Provide testing class methods with informative failure statements and
descriptive, one-line docstrings
* Block and inline comments should use proper English grammar and punctuation
with the exception of single sentences in a block, which may then omit the
final period
* When casting is necessary, use `np.int64` and `np.float64` to ensure operating
system agnosticism
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of pysat nor the names of its
* Neither the name of pysatCDF nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include *.py
include *.f
include *.c
include pysatCDF/version.txt
recursive-include cdf36_3-dist *
prune cdf36_3-dist/cdfjava
prune cdf36_3-dist/lib/*.o
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<div align="center">
<img height="0" width="0px">
<img width="20%" src="https://raw.githubusercontent.com/pysat/pysatCDF/main/docs/images/logo.png" alt="pysatCDF" title="pysatCDF"</img>
</div>

# pysatCDF
[![PyPI Package latest release](https://img.shields.io/pypi/v/pysatcdf.svg)](https://pypi.python.org/pypi/pysatcdf)
[![Build Status](https://github.com/pysat/pysatCDF/actions/workflows/main.yml/badge.svg)](https://github.com/pysat/pysatCDF/actions/workflows/main.yml/badge.svg)
Expand Down Expand Up @@ -40,7 +45,7 @@ Provide simple, robust access to CDF data in Python and simplify
adding instruments to [pysat](https://github.com/pysat/pysat).

# Installation in POSIX compatible environments
Actual CDF loading is performed by the [NASA CDF libraries] (http://cdf.gsfc.nasa.gov/html/sw_and_docs.html)
Actual CDF loading is performed by the [NASA CDF libraries](http://cdf.gsfc.nasa.gov/html/sw_and_docs.html)
which are included with pysatCDF.

To install pysatCDF
Expand All @@ -63,3 +68,4 @@ and then install pysatCDF as normal.
# Installing pysatCDF in Windows

Install the Windows Subsytem for Linux and proceed as per POSIX installation.

2 changes: 2 additions & 0 deletions bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"%PYTHON%" setup.py install
if errorlevel 1 exit 1
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python setup.py install
Binary file added docs/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package:
name: pysatcdf
version: 0.1

source:
path: ./

requirements:
build:
- python
- libpython # [win]
- numpy >=1.15
- m2-make # [win]
- m2-base # [win]
- m2w64-make # [win]
- m2w64-toolchain # [win]
- m2w64-gcc # [win]


run:
- python
- numpy >=1.15


test:
imports:
- pysatCDF


about:
home:
license: BSD
summary: Reader for NASA CDF files
8 changes: 4 additions & 4 deletions pysatCDF/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import os

# Set version
# Import CDF interface.
from pysatCDF._cdf import CDF as CDF

# Set version.
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'version.txt')) as version_file:
__version__ = version_file.read().strip()

# Import CDF interface
from ._cdf import CDF as CDF

del here
Loading

0 comments on commit eaaa239

Please sign in to comment.