Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Contributing
============

Please see the [project documentation](http://zarr.readthedocs.io/en/stable/contributing.html) for information about contributing to Zarr.

31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
For bug reports, please follow the template below. For enhancement proposals, feel free
to use whatever template makes sense.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good, but it doesn't show up currently (when rendered). Any reason for it to be commented?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, was just copying another example I'd seen.

-->

#### Minimal, reproducible code sample, a copy-pastable example if possible

```python
# Your code here

```

#### Problem description

Explain why the current behavior is a problem, what the expected output/behaviour
is, and why the expected output/behaviour is a better solution.

#### Version and installation information

Please provide the following:

* Value of ``zarr.__version__``
* Value of ``numcodecs.__version__``
* Version of Python interpreter
* Operating system (Linux/Windows/Mac)
* How Zarr was installed (e.g., "using pip into virtual environment", or "using conda")

Also, if you think it might be relevant, please provide the output from ``pip list`` or
``conda list`` depending on which was used to install Zarr.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might suggest conda env export and pip freeze instead. These produce files that can be used to immediately install a user's environment and begin playing with it. While conda list and pip list do provide the same info, there is no one liner that turns them into an environment on a dev's machine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Description of PR]

TODO:
* [ ] Unit tests and/or doctests in docstrings
* [ ] ``tox -e py36`` passes locally
* [ ] ``tox -e py27`` passes locally
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't think we need to be so formal. Maybe something like this for the first one. Similar for the second.

* [ ] Python 3.6 tests pass (e.g. ``tox -e py36``)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* [ ] Docstrings and API docs for any new/modified user-facing classes and functions
* [ ] New/modified features documented in docs/tutorial.rst
* [ ] Changes documented in docs/release.rst
* [ ] ``tox -e docs`` passes locally
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar story as above. Here some comment about the docs building ok.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* [ ] AppVeyor and Travis CI passes
* [ ] Test coverage to 100% (Coveralls passes)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Alistair Miles
Copyright (c) 2018 Zarr Developers <https://github.com/zarr-developers>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a range?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ more information.
.. image:: https://readthedocs.org/projects/zarr/badge/?version=latest
:target: http://zarr.readthedocs.io/en/latest/?badge=latest

.. image:: https://travis-ci.org/alimanfoo/zarr.svg?branch=master
:target: https://travis-ci.org/alimanfoo/zarr
.. image:: https://travis-ci.org/zarr-developers/zarr.svg?branch=master
:target: https://travis-ci.org/zarr-developers/zarr

.. image:: https://ci.appveyor.com/api/projects/status/7d4iko59k8hpbbik?svg=true
:target: https://ci.appveyor.com/project/alimanfoo/zarr
:target: https://ci.appveyor.com/project/zarr-developers/zarr

.. image:: https://coveralls.io/repos/github/alimanfoo/zarr/badge.svg?branch=master
:target: https://coveralls.io/github/alimanfoo/zarr?branch=master
.. image:: https://coveralls.io/repos/github/zarr-developers/zarr/badge.svg?branch=master
:target: https://coveralls.io/github/zarr-developers/zarr?branch=master
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __getattr__(cls, name):

numpydoc_show_class_members = False
numpydoc_class_members_toctree = False
issues_github_path = 'alimanfoo/zarr'
issues_github_path = 'zarr-developers/zarr'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -78,8 +78,8 @@ def __getattr__(cls, name):

# General information about the project.
project = 'zarr'
copyright = '2016, Alistair Miles'
author = 'Alistair Miles'
copyright = '2018, Zarr Developers'
author = 'Zarr Developers'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -258,7 +258,7 @@ def __getattr__(cls, name):
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'zarr.tex', 'zarr Documentation',
'Alistair Miles', 'manual'),
'Zarr Developers', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
201 changes: 201 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Contributing to Zarr
====================

Zarr is a community maintained project. We welcome contributions in the form of bug
reports, bug fixes, documentation, enhancement proposals and more. This page provides
information on how best to contribute.

Asking for help
---------------

If you have a question about how to use Zarr, please post your question on
StackOverflow using the `"zarr" tag <https://stackoverflow.com/questions/tagged/zarr>`_
. If you don't get a response within a day or two, feel free to raise a `GitHub issue
<https://github.com/zarr-developers/zarr/issues/new>`_ including a link to your StackOverflow
question. We will try to respond to questions as quickly as possible, but please bear
in mind that there may be periods where we have limited time to answer questions
due to other commitments.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


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

If you find a bug, please raise a `GitHub issue
<https://github.com/zarr-developers/zarr/issues/new>`_. Please include the following items in
a bug report:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely good. Should we link over to the issue template for more details?


1. A minimal, self-contained snippet of Python code reproducing the problem. You can
format the code nicely using markdown, e.g.::


```python
>>> import zarr
>>> g = zarr.group()
...
```

2. Information about the version of Zarr, along with versions of dependencies and the
Python interpreter, and installation information. The version of Zarr can be obtained
from the ``zarr.__version__`` property. Please also state how Zarr was installed,
e.g., "installed via pip into a virtual environment", or "installed using conda".
Information about other packages installed can be obtained by executing ``pip list``
(if using pip to install packages) or ``conda list`` (if using conda to install
packages) from the operating system command prompt. The version of the Python
interpreter can be obtained by running a Python interactive session, e.g.::

$ python
Python 3.6.1 (default, Mar 22 2017, 06:17:05)
[GCC 6.3.0 20170321] on linux

3. An explanation of why the current behaviour is wrong/not desired, and what you
expect instead.

Enhancement proposals
---------------------

If you have an idea about a new feature or some other improvement to Zarr, please raise a
`GitHub issue <https://github.com/zarr-developers/zarr/issues/new>`_ first to discuss.

We very much welcome ideas and suggestions for how to improve Zarr, but please bear in
mind that we are likely to be conservative in accepting proposals for new features. The
reasons for this are that we would like to keep the Zarr code base lean and focused on
a core set of functionalities, and available time for development, review and maintenance
of new features is limited. But if you have a great idea, please don't let that stop
you posting it on GitHub, just please don't be offended if we respond cautiously.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you posting -> you from posting

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Contributing code and/or documentation
--------------------------------------

Forking the repository
~~~~~~~~~~~~~~~~~~~~~~

The Zarr source code is hosted on GitHub at the following location:

* `https://github.com/zarr-developers/zarr <https://github.com/zarr-developers/zarr>`_

You will need your own fork to work on the code. Go to the link above and hit
the "Fork" button. Then clone your fork to your local machine::

$ git clone [email protected]:your-user-name/zarr.git
$ cd zarr
$ git remote add upstream [email protected]:zarr-developers/zarr.git

Creating a development environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To work with the Zarr source code, it is recommended to set up a Python virtual
environment and install all Zarr dependencies using the same versions as are used by
the core developers and continuous integration services. Assuming you have a Python
3 interpreter already installed, and have also installed the virtualenv package, and
you have cloned the Zarr source code and your current working directory is the root of
the repository, you can do something like the following::

$ mkdir -p ~/pyenv/zarr-dev
$ virtualenv --no-site-packages --python=/usr/bin/python3.6 ~/pyenv/zarr-dev
$ source ~/pyenv/zarr-dev/bin/activate
$ pip install -r requirements_dev.txt
$ pip install -r requirements_dev_optional.txt
$ pip install -e .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest also including an example of how to do this with conda. My experience is that this is a common workflow.

$ conda env create -n zarr-dev -f requirements_dev.yml  # req file would need to be added
$ source activate zarr-dev
$ pip install -e  # or python setup.py develop

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't give a conda example as (last time I looked) you can't use tox with conda, and tox is the best way at the moment to run all the tests (including doctests, coverage, flake8 etc.) and verify support for PY2 and PY3.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

virtualenv has been packaged and exists on defaults and conda-forge. Once that was done tox was added to conda-forge in short order.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll leave this as-is for now as I don't have time to verify all the steps to get tox fully up and running all test environments under a conda installation, but if someone wants to do this later and can provide the necessary commands then very happy to add.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. That was only meant as an informative comment. Happy with this as is.

To verify that your development environment is working, you can run the unit tests::

$ pytest -v zarr

Creating a branch
~~~~~~~~~~~~~~~~~

It's best to create a new, separate branch for each piece of work you want to do. E.g.::

git fetch upstream
git checkout -b shiny-new-feature upsteam/master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would probably drop the upsteam/master personally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not a bad idea, I've seen colleagues get mightily confused because of creating branches off old code or the wrong place.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a minor point. Mainly was mentioning this as it would not only checkout near upstream/master, but would set up shiny-new-feature to track upstream/master, which could be confusing when trying to push. Really not a big deal either way. Am ok with leaving it if you would rather.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK, didn't realise it would track upstream/master, that could be confusing. My normal workflow is:

git checkout master
git fetch upstream
git rebase upstream/master
git push origin master
git checkout -b shiny-new-feature
git push -u origin shiny-new-feature

...maybe that would be better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a side effect of it being a remote branch (as opposed to a local one).

I do something similar. That would probably be fine.


This changes your working directory to the shiny-new-feature branch. Keep any changes in
this branch specific to one bug or feature so it is clear what the branch brings to
Zarr.

To update this branch with latest code from Zarr, you can retrieve the changes from
the master branch::

git fetch upstream
git rebase upstream/master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I love rebasing personally, working with developers from various skill levels has caused me to suggest merging to more general audiences. Rebasing can mean trying to resolve many conflicts in many steps instead of all conflicts in one step. The latter seems to avoid many new issues cropping up and allows any new issues to be resolved in subsequent commits pretty easily. Not to mention merging tends to be friendlier if other people help out on your branch.

These are all personal opinions and observations over time. Feel free to ignore them if you have a strong preference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a fair point, I've seen people struggle with rebase, I remember the first time I tried it I went round in circles for about an hour before someone told me you had to do git push -f at the end.


This will replay your commits on top of the latest Zarr git master. If this leads to
merge conflicts, these need to be resolved before submitting a pull request.

Before you do any new work or submit a pull request, please open an issue on GitHub to
report the bug or propose the feature you'd like to add.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Maybe this should move up to the top of the section?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


Running the test suite
~~~~~~~~~~~~~~~~~~~~~~

Zarr includes a suite of unit tests, as well as doctests included in function and class
docstrings and in the tutorial and storage spec. The simplest way to run the unit tests
is to invoke::

$ pytest -v zarr

To also run the doctests within docstrings, run::

$ pytest -v --doctest-modules zarr

To run the doctests within the tutorial and storage spec, run::

$ python -m doctest -o NORMALIZE_WHITESPACE -o ELLIPSIS docs/tutorial.rst docs/spec/v2.rst

Tests can be run under different Python versions using tox. E.g. (assuming you have the
corresponding Python interpreters installed on your system)::

$ tox -e py27,py34,py35,py36

Zarr currently supports Python 2.7 and Python 3.4-3.6, so the above command must
succeed before code can be accepted into the main code base. Note that only the py36
tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.6.

All tests are automatically run via Travis (Linux) and AppVeyor (Windows) continuous
integration services for every pull request. Tests must pass under both services before
code can be accepted.
Copy link
Member

@jakirkham jakirkham Jan 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make a note about coverage requirements here too? For example, "total coverage over all builds must 100% (individual builds may be lower due to Python 2/3 or other differences)."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops...should have kept reading. 😳 Though a one liner here would still be nice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Code standards
~~~~~~~~~~~~~~

All code must conform to the PEP8 standard. Regarding line length, lines up to 100
characters are allowed, although please try to keep under 90 wherever possible.
Conformance can be checked by running::

$ flake8 --max-line-length=100 zarr

This is automatically run when invoking ``tox -e py36``.

Test coverage
~~~~~~~~~~~~~

Zarr maintains 100% test coverage under the latest Python stable release (currently
Python 3.6). Both unit tests and docstring doctests are included when computing
coverage. Running ``tox -e py36`` will automatically run the test suite with coverage
and produce a coverage report. This should be 100% before code can be accepted into the
main code base.

When submitting a pull request, coverage will also be collected across all supported
Python versions via the Coveralls service, and will be reported back within the pull
request. Coveralls coverage must also be 100% before code can be accepted.

Documentation
~~~~~~~~~~~~~

Docstrings for user-facing classes and functions should follow the `numpydoc
<https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_ standard,
including sections for Parameters and Examples. All examples will be run as doctests
under Python 3.6.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Python 3.6 -> Python 3.6 only

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Zarr uses Sphinx for documentation, hosted on readthedocs.org. Documentation is
written in the RestructuredText markup language (.rst files) in the ``docs`` folder.
The documentation consists both of prose and API documentation. All user-facing classes
and functions should be included in the API documentation, under the ``docs/api``
folder. Any new features or important usage information should be included in the
tutorial (``docs/tutorial.rst``). Any changes should also be included in the release
notes (``docs/release.rst``).

The documentation can be built by running::

$ tox -e docs

The resulting built documentation will be available in the ``.tox/docs/tmp/html`` folder.
12 changes: 10 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Status
------

Zarr is still a young project. Feedback and bug reports are very welcome, please get in touch via
the `GitHub issue tracker <https://github.com/alimanfoo/zarr/issues>`_.
the `GitHub issue tracker <https://github.com/zarr-developers/zarr/issues>`_. See
:doc:`contributing` for further information about contributing to Zarr.

Installation
------------
Expand All @@ -42,7 +43,7 @@ Alternatively, install Zarr via conda::

To work with Zarr source code in development, install from GitHub::

$ git clone --recursive https://github.com/alimanfoo/zarr.git
$ git clone --recursive https://github.com/zarr-developers/zarr.git
$ cd zarr
$ python setup.py install

Expand All @@ -61,6 +62,13 @@ Contents
api
spec
release
contributing

Projects using Zarr
-------------------

If you are using Zarr, we would `love to hear about it
<https://github.com/zarr-developers/zarr/issues/228>`_.

Acknowledgments
---------------
Expand Down
16 changes: 7 additions & 9 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Enhancements
properties that enable a selection of items in an array to be retrieved or
updated. See the :ref:`tutorial_indexing` tutorial section for more
information. There is also a `notebook
<https://github.com/alimanfoo/zarr/blob/master/notebooks/advanced_indexing.ipynb>`_
<https://github.com/zarr-developers/zarr/blob/master/notebooks/advanced_indexing.ipynb>`_
with extended examples and performance benchmarks. :issue:`78`, :issue:`89`,
:issue:`112`, :issue:`172`.

Expand Down Expand Up @@ -340,8 +340,8 @@ Storage
~~~~~~~

The main motivation for re-organizing the code was to create an
abstraction layer between the core array logic and data storage (`#21
<https://github.com/alimanfoo/zarr/issues/21>`_). In this release, any
abstraction layer between the core array logic and data storage (:issue:`21`).
In this release, any
object that implements the ``MutableMapping`` interface can be used as
an array store. See the tutorial sections on :ref:`tutorial_persist`
and :ref:`tutorial_storage`, the :ref:`spec_v1`, and the
Expand Down Expand Up @@ -392,8 +392,7 @@ performance improvement for multi-threaded compression operations.

The :mod:`zarr.blosc` extension now automatically detects whether it
is running within a single-threaded or multi-threaded program and
adapts its internal behaviour accordingly (`#27
<https://github.com/alimanfoo/zarr/issues/27>`_). There is no need for
adapts its internal behaviour accordingly (:issue:`27`). There is no need for
the user to make any API calls to switch Blosc between contextual and
non-contextual (global lock) mode. See also the tutorial section on
:ref:`tutorial_tips_blosc`.
Expand All @@ -409,8 +408,7 @@ option present in the previous release, and this has been removed.

The memory layout within chunks can now be set as either "C"
(row-major) or "F" (column-major), which can help to provide better
compression for some data (`#7
<https://github.com/alimanfoo/zarr/issues/7>`_). See the tutorial
compression for some data (:issue:`7`). See the tutorial
section on :ref:`tutorial_chunks_order` for more information.

A bug has been fixed within the ``__getitem__`` and ``__setitem__``
Expand All @@ -430,14 +428,14 @@ Thanks to :user:`Matthew Rocklin <mrocklin>`, :user:`Stephan Hoyer <shoyer>`,
-----

See `v0.4.0 release notes on GitHub
<https://github.com/alimanfoo/zarr/releases/tag/v0.4.0>`_.
<https://github.com/zarr-developers/zarr/releases/tag/v0.4.0>`_.

.. _release_0.3.0:

0.3.0
-----

See `v0.3.0 release notes on GitHub
<https://github.com/alimanfoo/zarr/releases/tag/v0.3.0>`_.
<https://github.com/zarr-developers/zarr/releases/tag/v0.3.0>`_.

.. _NumCodecs: http://numcodecs.readthedocs.io/
Loading