Skip to content

Commit 7a04179

Browse files
authored
Merge pull request #6 from chrishavlin/release_prep
Release prep
2 parents 88e8cbe + d46ad0d commit 7a04179

19 files changed

+756
-389
lines changed

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.
File renamed without changes.
Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
.. highlight:: shell
21

3-
============
4-
Contributing
5-
============
2+
# Contributing
63

74
Contributions are welcome, and they are greatly appreciated! Every little bit
85
helps, and credit will always be given.
96

107
You can contribute in many ways:
118

12-
Types of Contributions
13-
----------------------
9+
## Types of Contributions
10+
11+
### Report Bugs
1412

15-
Report Bugs
16-
~~~~~~~~~~~
1713

1814
Report bugs at https://github.com/chrishavlin/yt_xarray/issues.
1915

@@ -23,27 +19,23 @@ If you are reporting a bug, please include:
2319
* Any details about your local setup that might be helpful in troubleshooting.
2420
* Detailed steps to reproduce the bug.
2521

26-
Fix Bugs
27-
~~~~~~~~
22+
### Fix Bugs
2823

2924
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
3025
wanted" is open to whoever wants to implement it.
3126

32-
Implement Features
33-
~~~~~~~~~~~~~~~~~~
27+
### Implement Features
3428

3529
Look through the GitHub issues for features. Anything tagged with "enhancement"
3630
and "help wanted" is open to whoever wants to implement it.
3731

38-
Write Documentation
39-
~~~~~~~~~~~~~~~~~~~
32+
### Write Documentation
4033

4134
yt_xarray could always use more documentation, whether as part of the
4235
official yt_xarray docs, in docstrings, or even on the web in blog posts,
4336
articles, and such.
4437

45-
Submit Feedback
46-
~~~~~~~~~~~~~~~
38+
### Submit Feedback
4739

4840
The best way to send feedback is to file an issue at https://github.com/chrishavlin/yt_xarray/issues.
4941

@@ -54,75 +46,91 @@ If you are proposing a feature:
5446
* Remember that this is a volunteer-driven project, and that contributions
5547
are welcome :)
5648

57-
Get Started!
58-
------------
49+
## Get Started!
5950

6051
Ready to contribute? Here's how to set up `yt_xarray` for local development.
6152

6253
1. Fork the `yt_xarray` repo on GitHub.
63-
2. Clone your fork locally::
64-
65-
$ git clone [email protected]:your_name_here/yt_xarray.git
54+
2. Clone your fork locally:
55+
```
56+
$ git clone [email protected]:your_name_here/yt_xarray.git
57+
```
6658

6759
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
60+
```
61+
$ mkvirtualenv yt_xarray
62+
$ cd yt_xarray/
63+
$ python -m pip install -e .
64+
$ python -m pip install -r requirements_dev.txt
65+
```
66+
4. (optional) Setup pre-commit
67+
```
68+
$ pre-commit install
69+
```
6870

69-
$ mkvirtualenv yt_xarray
70-
$ cd yt_xarray/
71-
$ python setup.py develop
71+
5. Create a branch for local development::
7272

73-
4. Create a branch for local development::
73+
```
74+
$ git checkout -b name-of-your-bugfix-or-feature
75+
```
76+
Now you can make your changes locally.
7477

75-
$ git checkout -b name-of-your-bugfix-or-feature
78+
6. When you're done making changes, check that your changes pass the
79+
tests:
7680

77-
Now you can make your changes locally.
81+
```
82+
$ pytest
83+
```
84+
To test multiple python versions, you can use `tox`:
7885

79-
5. When you're done making changes, check that your changes pass flake8 and the
80-
tests, including testing other Python versions with tox::
86+
```
87+
$ tox
88+
```
8189

82-
$ flake8 yt_xarray tests
83-
$ python setup.py test or pytest
84-
$ tox
8590

86-
To get flake8 and tox, just pip install them into your virtualenv.
91+
7. Commit your changes and push your branch to GitHub:
8792

88-
6. Commit your changes and push your branch to GitHub::
93+
```
94+
$ git add .
95+
$ git commit -m "Your detailed description of your changes."
96+
```
97+
If you've installed pre-commit, then pre-commit will run your changes through
98+
some style checks. It will try to fix files if needed. If it finds errors, you
99+
will need to re-add those files (after fixing it if pre-commit could not do so
100+
automatically) and then commit again.
89101

90-
$ git add .
91-
$ git commit -m "Your detailed description of your changes."
92-
$ git push origin name-of-your-bugfix-or-feature
102+
Now your branch is ready to push:
93103

94-
7. Submit a pull request through the GitHub website.
104+
```
105+
$ git push origin name-of-your-bugfix-or-feature
106+
```
95107

96-
Pull Request Guidelines
97-
-----------------------
108+
8. Submit a pull request through the GitHub website.
109+
110+
## Pull Request Guidelines
98111

99112
Before you submit a pull request, check that it meets these guidelines:
100113

101114
1. The pull request should include tests.
102115
2. If the pull request adds functionality, the docs should be updated. Put
103-
your new functionality into a function with a docstring, and add the
104-
feature to the list in README.rst.
105-
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
106-
https://travis-ci.com/chrishavlin/yt_xarray/pull_requests
107-
and make sure that the tests pass for all supported Python versions.
116+
your new functionality into a function with a docstring.
117+
3. The pull request should pass all automated tests.
108118

109-
Tips
110-
----
119+
## Tips
111120

112-
To run a subset of tests::
121+
To run a subset of tests:
113122

114123
$ pytest tests.test_yt_xarray
115124

116125

117-
Deploying
118-
---------
126+
## Deploying
119127

120128
A reminder for the maintainers on how to deploy.
121-
Make sure all your changes are committed (including an entry in HISTORY.rst).
122-
Then run::
129+
Make sure all your changes are committed (including an entry in HISTORY.md).
123130

131+
```
124132
$ bump2version patch # possible: major / minor / patch
125133
$ git push
126134
$ git push --tags
127-
128-
Travis will then deploy to PyPI if tests pass.
135+
```
136+
github will then push to PyPI if tests pass.
File renamed without changes.

MANIFEST.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
include AUTHORS.rst
2-
include CONTRIBUTING.rst
3-
include HISTORY.rst
1+
include *.md
2+
recursive-include examples *.ipynb
3+
recursive-exclude examples .ipynb_checkpoints *.ipynb
44
include LICENSE
5-
include README.rst
65
include *.txt
76
include *.yaml
87
include Makefile

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# yt_xarray
2+
3+
4+
[![PyPI version](https://badge.fury.io/py/yt_xarray.svg)](https://badge.fury.io/py/yt_xarray)
5+
6+
7+
interfaces between yt and xarray
8+
9+
10+
## Features
11+
12+
This is an experimental package for improving the exhange of data between yt
13+
and xarray. The primary access point is the `YtAccessor` object for xarray. To
14+
use it, simply import the package and the `.yt` object will be available to
15+
xarray datasets. For example, to convert the xarray dataset into a full-fledged
16+
yt dataset:
17+
18+
```python
19+
import xarray as xr
20+
import yt_xarray
21+
22+
ds = xr.open_dataset(...)
23+
yt_ds = ds.yt.ds()
24+
```
25+
In this example, `ds.yt.ds()` returns a yt dataset built using the new (as of
26+
yt 4.1.0) callable functionality to reference the open xarray ds handle. See
27+
the [example notebooks](https://github.com/data-exp-lab/yt_xarray/tree/main/examples)
28+
for more approaches.
29+
30+
## Limitations
31+
32+
There are many known (and likely unknown) limitations, here are the most pressing:
33+
* 3D variables are required for yt functionality
34+
* If you have variables on different grids, you must specify the variables you want to load in yt.
35+
* Geometry: the beta version was built using sample domain data from seismology, so there are likely lingering assumptions...
36+
37+
If you try it out and find any issues, please report via [github](https://github.com/data-exp-lab/yt_xarray/issues).
38+
39+
40+
## Contributions
41+
42+
Contributions are welcome, see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

README.rst

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)