From d7f23a1a15f2ce9af2cc7c28df408ef919193744 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Tue, 17 Sep 2019 11:06:22 -0700 Subject: [PATCH] Repo cleanup (#1055) * Replace refs to Appveyor/Travis with Azure * Move code of conduct and issue and PR templates to .github * Fix typos, formatting, old references * Remove dummy job from Azure * Remove unused example documentation code --- {docs => .github}/CODE_OF_CONDUCT.rst | 0 .github/ISSUE_TEMPLATE/bug_report.md | 33 +++++ .github/ISSUE_TEMPLATE/feature_request.md | 30 ++++ {docs => .github}/PULL_REQUEST_TEMPLATE.md | 4 +- Makefile | 2 +- README.rst | 10 +- azure-pipelines.yml | 22 --- docs/CONTRIBUTING.rst | 30 ++-- docs/ISSUE_TEMPLATE.md | 28 ---- docs/code/creating-and-writing-nwbfile.py | 165 --------------------- docs/source/make_a_release.rst | 9 +- 11 files changed, 87 insertions(+), 246 deletions(-) rename {docs => .github}/CODE_OF_CONDUCT.rst (100%) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md rename {docs => .github}/PULL_REQUEST_TEMPLATE.md (79%) delete mode 100644 docs/ISSUE_TEMPLATE.md delete mode 100644 docs/code/creating-and-writing-nwbfile.py diff --git a/docs/CODE_OF_CONDUCT.rst b/.github/CODE_OF_CONDUCT.rst similarity index 100% rename from docs/CODE_OF_CONDUCT.rst rename to .github/CODE_OF_CONDUCT.rst diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..e8559d83d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ +--- +name: Bug report +about: Create a report to help us fix a bug +title: '' +labels: bug +assignees: '' + +--- + +## Description + + + +## Steps to Reproduce + + + +## Environment + + + + Python Executable: Conda or Python + Python Version: Python 3.5, 3.6, or 3.7 + Operating System: Windows, macOS or Linux + HDMF Version: Version of PyNWB used + +## Checklist + +- [ ] Have you ensured the feature or change was not already [reported](https://github.com/NeurodataWithoutBorders/pynwb/issues)? +- [ ] Have you included a brief and descriptive title? +- [ ] Have you included a clear description of the problem you are trying to solve? +- [ ] Have you included a minimal code snippet that reproduces the issue you are encountering? +- [ ] Have you checked our [Contributing](https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/docs/CONTRIBUTING.rst) document? diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..1c8f149d7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,30 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +Briefly describe the needed feature as well as the reasoning behind it + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm trying to achieve [...] + +**Describe the solution you'd like** +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. + +**Additional context** +Add any other context or screenshots about the feature request here. + +## Checklist + +- [ ] Have you ensured the feature or change was not already [reported](https://github.com/NeurodataWithoutBorders/pynwb/issues)? +- [ ] Have you included a brief and descriptive title? +- [ ] Have you included a clear description of the problem you are trying to solve? +- [ ] Have you included a minimal code snippet that reproduces the issue you are encountering? +- [ ] Have you checked our [Contributing](https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/docs/CONTRIBUTING.rst) document? diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 79% rename from docs/PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md index 7c49cb9e9..d3b9783b1 100644 --- a/docs/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -11,6 +11,6 @@ Show here how to reproduce the new behavior (can be a bug fix or a new feature) - [ ] Have you checked our [Contributing](https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/docs/CONTRIBUTING.rst) document? - [ ] Have you ensured the PR description clearly describes problem and the solution? -- [ ] Is your contribution compliant with our coding style ? This can be checked running `flake8` from the source directory. +- [ ] Is your contribution compliant with our coding style? This can be checked running `flake8` from the source directory. - [ ] Have you checked to ensure that there aren't other open [Pull Requests](https://github.com/NeurodataWithoutBorders/pynwb/pulls) for the same change? -- [ ] Have you included the relevant issue number using `#XXX` notation where `XXX` is the issue number ? +- [ ] Have you included the relevant issue number using `#XXX` notation where `XXX` is the issue number? diff --git a/Makefile b/Makefile index 0304c9a99..d7b0323e1 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ checkpdb: find {src,tests} -name "*.py" -exec grep -Hn -e pdb -e breakpoint {} \; devtest: - $(PYTHON) -W ignore:::pynwb.form.build.map: test.py -fpi + $(PYTHON) test.py testclean: rm *.npy *.nwb *.yaml diff --git a/README.rst b/README.rst index 7ed837b01..c553270e9 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ PyNWB Documentation of PyNWB can be found at https://pynwb.readthedocs.io Latest Release --------------- +============== .. image:: https://badge.fury.io/py/pynwb.svg :target: https://badge.fury.io/py/pynwb @@ -15,7 +15,7 @@ Latest Release Build Status ------------- +============ .. table:: @@ -35,7 +35,7 @@ Build Status Overall Health --------------- +============== .. image:: https://codecov.io/gh/NeurodataWithoutBorders/pynwb/branch/dev/graph/badge.svg :target: https://codecov.io/gh/NeurodataWithoutBorders/pynwb @@ -67,12 +67,12 @@ See the PyNWB documentation for details http://pynwb.readthedocs.io/en/latest/ge Code of Conduct =============== -This project and everyone participating in it is governed by our `code of conduct guidelines `_ . By participating, you are expected to uphold this code. +This project and everyone participating in it is governed by our `code of conduct guidelines <.github/CODE_OF_CONDUCT.rst>`_. By participating, you are expected to uphold this code. Contributing ============ -For details on how to contribute to PyNWB see our `contribution guidelines `_ . +For details on how to contribute to PyNWB see our `contribution guidelines `_. LICENSE ======= diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bc2c5c557..db45ebd05 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,30 +3,8 @@ trigger: jobs: -- job: 'Dummy' - displayName: 'Dummy' - - pool: - vmImage: 'ubuntu-16.04' - - steps: - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - architecture: 'x64' - - - script: | - python -m pip install --upgrade pip - displayName: 'Install build dependencies' - - - script: | - python --version - displayName: 'Check Python version' - - job: 'Test' displayName: "Test PyNWB" - dependsOn: Dummy strategy: matrix: diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst index 2f0ed976f..24c7737bd 100644 --- a/docs/CONTRIBUTING.rst +++ b/docs/CONTRIBUTING.rst @@ -6,7 +6,7 @@ How to contribute to NWB:N software and documents Code of Conduct --------------- -This project and everyone participating in it is governed by our `code of conduct guidelines `_. By participating, you are expected to uphold this code. Please report unacceptable behavior. +This project and everyone participating in it is governed by our `code of conduct guidelines `_. By participating, you are expected to uphold this code. Please report unacceptable behavior. .. _sec-contribution-types: @@ -18,11 +18,11 @@ Did you find a bug? or Do you intend to add a new feature or change an existing * **Identify the appropriate repository** for the change you are suggesting: - * Use `nwb_schema `_ for any changes to the NWB:N format schema, schema language, storage and other NWB:N related documents + * Use `nwb-schema `_ for any changes to the NWB:N format schema, schema language, storage, and other NWB:N related documents * Use `PyNWB `_ for any changes regarding the PyNWB API and the corresponding documentation * Use `MatNWB `_ for any changes regarding the PyNWB API and the corresponding documentation -* **Ensure the feature or change was not already reported** by searching on GitHub under `PyNWB Issues `_ and `nwh-schema issues `_ , respectively . +* **Ensure the feature or change was not already reported** by searching on GitHub under `PyNWB Issues `_ and `nwb-schema issues `_, respectively . * If you are unable to find an open issue addressing the problem then open a new issue on the respective repository. Be sure to include: @@ -38,25 +38,22 @@ Did you write a patch that fixes a bug or implements a new feature? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ See the ``Contributing Patches and Changes`` section below for details. - Do you have questions about NWB:N? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Join the `NWB:N mailing list `_ for updates or ask questions on our `google group `_. - +Ask questions on our `Slack workspace `_ or sign up for our `NWB:N mailing list `_ for updates. -Informal discussions between developers, users, and team? +Informal discussions between developers and users? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The https://nwb-users.slack.com slack is currently used mainly for internal discussions between developers, users, and teams. - +The https://nwb-users.slack.com slack is currently used mainly for informal discussions between developers and users. .. _sec-contributing: Contributing Patches and Changes -------------------------------- -The ``dev`` branches of `PyNWB `_ and `nwb_schema `_, are protected; you cannot push to them directly. You must upload your changes by pushing a new branch, then submit your changes to the ``dev`` branch via a `Pull Request `_. This allows us to conduct automated testing of your contribution, and gives us a space for developers to discuss the contribution and request changes. If you decide to tackle an issue, please make yourself an assignee on the issue to communicate this to the team. Don't worry - this does not commit you to solving this issue. It just lets others know who they should talk to about it. +The ``dev`` branches of `PyNWB `_ and `nwb-schema `_, are protected; you cannot push to them directly. You must upload your changes by pushing a new branch, then submit your changes to the ``dev`` branch via a `Pull Request `_. This allows us to conduct automated testing of your contribution, and gives us a space for developers to discuss the contribution and request changes. If you decide to tackle an issue, please make yourself an assignee on the issue to communicate this to the team. Don't worry - this does not commit you to solving this issue. It just lets others know who they should talk to about it. From your local copy directory, use the following commands. @@ -90,7 +87,6 @@ If you have not already, you will need to clone the repo: * If you would like help with your contribution, or would like to communicate contributions that are not ready to merge, submit a PR where the title begins with "[WIP]." * **NOTE:** Contributed branches will be removed by the development team after the merge is complete and should, hence, not be used after the pull request is complete. - .. _sec-issue-labels: Issue Labels, Projects, and Milestones @@ -134,15 +130,13 @@ Git Commit Message Styleguide Documentation Styleguide ^^^^^^^^^^^^^^^^^^^^^^^^ -All documentations is written in reStrcuturedText (RST) using Sphinx. - +All documentations is written in reStructuredText (RST) using Sphinx. Did you fix whitespace, format code, or make a purely cosmetic patch in source code? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Source code changes that are purely cosmetic in nature and do not add anything substantial to the stability, functionality, or testability will generally not be accepted unless they have been approved beforehand. One of the main reasons is that there are a lot of hidden costs in addition to writing the code itself, and with the limited resources of the project, we need to optimize developer time. E.g,. someone needs to test and review PRs, backporting of bug fixes gets harder, it creates noise and pollutes the git repo and many other cost factors. - Format Specification Styleguide ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -151,20 +145,20 @@ Format Specification Styleguide Python Code Styleguide ^^^^^^^^^^^^^^^^^^^^^^ -Python coding style is checked via ``flake8`` for automatic checking of PEP8 style during pull requets. +Python coding style is checked via ``flake8`` for automatic checking of PEP8 style during pull requests. Endorsement ----------- Please don’t take the fact that working with an organization (e.g., during a hackathon or via GitHub) as an endorsement of your work or your organization. It’s okay to say e.g., “We worked with XXXXX to advance science” but not e.g., “XXXXX supports our work on NWB”.” -Licence and Copyright +License and Copyright ======================= -See the `Readme `_ and correspoding `licence `_ files for details about the copyright and licence. +See the `license `_ files for details about the copyright and license. As indicated in the PyNWB license: *“You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to Lawrence Berkeley National Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form.”* -Contributors to the NWB code base are expected to use a permissive, non-copyleft open source license. Typically 3-clause BSD i used, but any compatible license is allowed, the MIT and Apache 2.0 licenses being good alternative choices. The GPL and other copyleft licenses are not allowed due to the consternation it generates across many organizations. +Contributors to the NWB code base are expected to use a permissive, non-copyleft open source license. Typically 3-clause BSD is used, but any compatible license is allowed, the MIT and Apache 2.0 licenses being good alternative choices. The GPL and other copyleft licenses are not allowed due to the consternation it generates across many organizations. Also, make sure that you are permitted to contribute code. Some organizations, even academic organizations, have agreements in place that discuss IP ownership in detail (i.e., address IP rights and ownership that you create while under the employ of the organization). These are typically signed documents that you looked at on your first day of work and then promptly forgot. We don’t want contributed code to be yanked later due to IP issues. diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md deleted file mode 100644 index 9e038fba6..000000000 --- a/docs/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,28 +0,0 @@ -## 1) Bug - -If you are reporting a bug please provide the following: -### Steps to Reproduce -```python -Provide a minimal code snippet here to reproduce this error. -``` - -### Environment -Please describe your environment according to the following bullet points. -- **Python Executable:** Conda or Python -- **Python Version:** Python 3.5, 3.6, or 3.7 -- **Operating System:** Windows, macOS, or Linux -- **PyNWB Version:** Version of PyNWB used - -## 2) Feature Request -If you are requesting a feature please provide the following: - -### Problem/Use Case -Briefly describe the needed feature as well as the reasoning behind it - -## Checklist - -- [ ] Have you ensured the feature or change was not already [reported](https://github.com/NeurodataWithoutBorders/pynwb/issues/) ? -- [ ] Have you included a brief and descriptive title? -- [ ] Have you included a clear description of the problem you are trying to solve? -- [ ] Have you included a minimal code snippet that reproduces the issue you are encountering? -- [ ] Have you checked our [Contributing](https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/docs/CONTRIBUTING.rst) document? diff --git a/docs/code/creating-and-writing-nwbfile.py b/docs/code/creating-and-writing-nwbfile.py deleted file mode 100644 index 98193ed0a..000000000 --- a/docs/code/creating-and-writing-nwbfile.py +++ /dev/null @@ -1,165 +0,0 @@ - -def main(): - - import os.path - - # prerequisites: start - import numpy as np - - rate = 10.0 - np.random.seed(1234) - data_len = 1000 - ephys_data = np.random.rand(data_len) - ephys_timestamps = np.arange(data_len) / rate - spatial_timestamps = ephys_timestamps[::10] - spatial_data = np.cumsum(np.random.normal(size=(2, len(spatial_timestamps))), axis=-1).T - # prerequisites: end - - # create-nwbfile: start - from datetime import datetime - from dateutil.tz import tzlocal - from pynwb import NWBFile - - f = NWBFile('the PyNWB tutorial', 'my first synthetic recording', 'EXAMPLE_ID', datetime.now(tzlocal()), - experimenter='Dr. Bilbo Baggins', - lab='Bag End Laboratory', - institution='University of Middle Earth at the Shire', - experiment_description='I went on an adventure with thirteen dwarves to reclaim vast treasures.', - session_id='LONELYMTN') - # create-nwbfile: end - - # save-nwbfile: start - from pynwb import NWBHDF5IO - - filename = "example.h5" - io = NWBHDF5IO(filename, mode='w') - io.write(f) - io.close() - # save-nwbfile: end - - os.remove(filename) - - # create-device: start - device = f.create_device(name='trodes_rig123', source="a source") - # create-device: end - - # create-electrode-groups: start - electrode_name = 'tetrode1' - source = "an hypothetical source" - description = "an example tetrode" - location = "somewhere in the hippocampus" - - electrode_group = f.create_electrode_group(electrode_name, - source=source, - description=description, - location=location, - device=device) - - # create-electrode-groups: end - - # create-electrode-table-region: start - for idx in [1, 2, 3, 4]: - f.add_electrode(idx, - x=1.0, y=2.0, z=3.0, - imp=float(-idx), - location='CA1', filtering='none', - description='channel %s' % idx, group=electrode_group) - - electrode_table_region = f.create_electrode_table_region([0, 2], 'the first and third electrodes') - # create-electrode-table-region: end - - # create-timeseries: start - from pynwb.ecephys import ElectricalSeries - from pynwb.behavior import SpatialSeries - - ephys_ts = ElectricalSeries('test_ephys_data', - 'an hypothetical source', - ephys_data, - electrode_table_region, - timestamps=ephys_timestamps, - # Alternatively, could specify starting_time and rate as follows - # starting_time=ephys_timestamps[0], - # rate=rate, - resolution=0.001, - comments="This data was randomly generated with numpy, using 1234 as the seed", - description="Random numbers generated with numpy.random.rand") - f.add_acquisition(ephys_ts) - - spatial_ts = SpatialSeries('test_spatial_timeseries', - 'a stumbling rat', - spatial_data, - 'origin on x,y-plane', - timestamps=spatial_timestamps, - resolution=0.1, - comments="This data was generated with numpy, using 1234 as the seed", - description="This 2D Brownian process generated with " - "np.cumsum(np.random.normal(size=(2, len(spatial_timestamps))), axis=-1).T") - f.add_acquisition(spatial_ts) - # create-timeseries: end - - # create-data-interface: start - from pynwb.ecephys import LFP - from pynwb.behavior import Position - - lfp = f.add_acquisition(LFP('a hypothetical source')) - ephys_ts = lfp.create_electrical_series('test_ephys_data', - 'an hypothetical source', - ephys_data, - electrode_table_region, - timestamps=ephys_timestamps, - resolution=0.001, - comments="This data was randomly generated with numpy, using 1234 as the seed", # noqa: E501 - description="Random numbers generated with numpy.random.rand") - - pos = f.add_acquisition(Position('a hypothetical source')) - spatial_ts = pos.create_spatial_series('test_spatial_timeseries', - 'a stumbling rat', - spatial_data, - 'origin on x,y-plane', - timestamps=spatial_timestamps, - resolution=0.1, - comments="This data was generated with numpy, using 1234 as the seed", - description="This 2D Brownian process generated with " - "np.cumsum(np.random.normal(size=(2, len(spatial_timestamps))), axis=-1).T") # noqa: E501 - # create-data-interface: end - - # create-epochs: start - epoch_tags = ('example_epoch',) - - f.add_epoch(name='epoch1', start_time=0.0, stop_time=1.0, tags=epoch_tags, - description="the first test epoch", timeseries=[ephys_ts, spatial_ts]) - - f.add_epoch(name='epoch2', start_time=0.0, stop_time=1.0, tags=epoch_tags, - description="the second test epoch", timeseries=[ephys_ts, spatial_ts]) - # create-epochs: end - - # create-compressed-timeseries: start - from pynwb.ecephys import ElectricalSeries - from pynwb.behavior import SpatialSeries - from hdmf.backends.hdf5 import H5DataIO - - ephys_ts = ElectricalSeries('test_compressed_ephys_data', - 'an hypothetical source', - H5DataIO(ephys_data, compress=True), - electrode_table_region, - timestamps=H5DataIO(ephys_timestamps, compress=True), - resolution=0.001, - comments="This data was randomly generated with numpy, using 1234 as the seed", - description="Random numbers generated with numpy.random.rand") - f.add_acquisition(ephys_ts) - - spatial_ts = SpatialSeries('test_compressed_spatial_timeseries', - 'a stumbling rat', - H5DataIO(spatial_data, compress=True), - 'origin on x,y-plane', - timestamps=H5DataIO(spatial_timestamps, compress=True), - resolution=0.1, - comments="This data was generated with numpy, using 1234 as the seed", - description="This 2D Brownian process generated with " - "np.cumsum(np.random.normal(size=(2, len(spatial_timestamps))), axis=-1).T") - f.add_acquisition(spatial_ts) - # create-compressed-timeseries: end - - -if __name__ == "__main__": - main() diff --git a/docs/source/make_a_release.rst b/docs/source/make_a_release.rst index 076019bbe..aaf57365e 100644 --- a/docs/source/make_a_release.rst +++ b/docs/source/make_a_release.rst @@ -16,7 +16,7 @@ A core developer should use the following steps to create a release `X.Y.Z` of * Prerequisites ------------- -* All CI tests are passing on `AppVeyor`_, `CircleCI`_ and `Travis CI`_. +* All CI tests are passing on `CircleCI`_ and `Azure Pipelines`_. * You have a `GPG signing key `_. @@ -66,7 +66,7 @@ Setting up environment PyPI: Step-by-step ------------------ -1. Make sure that all CI tests are passing on `AppVeyor`_, `CircleCI`_ and `Travis CI`_. +1. Make sure that all CI tests are passing on `CircleCI`_ and `Azure Pipelines`_. 2. List all tags sorted by version @@ -118,7 +118,7 @@ PyPI: Step-by-step and source distribution on `PyPI`_. -7. Check the status of the builds on `AppVeyor`_, `CircleCI`_ and `Travis CI`_. +7. Check the status of the builds on `CircleCI`_ and `Azure Pipelines`_. 8. Once the builds are completed, check that the distributions are available on `PyPI`_ and that @@ -151,9 +151,8 @@ PyPI: Step-by-step .. _virtualenv: http://virtualenv.readthedocs.io .. _venv: https://docs.python.org/3/library/venv.html -.. _AppVeyor: https://ci.appveyor.com/project/NeurodataWithoutBorders/pynwb/history .. _CircleCI: https://circleci.com/gh/NeurodataWithoutBorders/pynwb -.. _Travis CI: https://travis-ci.org/NeurodataWithoutBorders/pynwb/builds +.. _Azure Pipelines: https://dev.azure.com/NeurodataWithoutBorders/pynwb/_build .. _PyPI: https://pypi.org/project/pynwb