Skip to content

Commit

Permalink
Add core functionality for parsing attributes from an open file (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 committed Jun 24, 2020
1 parent a07248b commit e5108a4
Show file tree
Hide file tree
Showing 27 changed files with 729 additions and 175 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:

- name: Install package
run: |
sudo apt-get update && sudo apt-get install pandoc -y
python -m pip install --upgrade pip
python -m pip install -e .
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ venv.bak/

# mypy
.mypy_cache/


.DS_Store
.vscode/
19 changes: 12 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: double-quote-string-fixer
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: double-quote-string-fixer

- repo: https://github.com/ambv/black
rev: 19.10b0
Expand All @@ -24,8 +24,13 @@ repos:
- repo: https://github.com/asottile/seed-isort-config
rev: v2.1.1
hooks:
- id: seed-isort-config
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
- id: isort

- repo: https://github.com/deathbeds/prenotebook
rev: master
hooks:
- id: prenotebook
30 changes: 15 additions & 15 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=============================================
Contributing to ecg
Contributing to ecgtools
=============================================

Contributions are highly welcomed and appreciated. Every little help counts,
so do not hesitate!

The following sections cover some general guidelines
regarding development in ecg for maintainers and contributors.
regarding development in ecgtools for maintainers and contributors.
Nothing here is set in stone and can't be changed.
Feel free to suggest improvements or changes in the workflow.

Expand All @@ -22,10 +22,10 @@ Feel free to suggest improvements or changes in the workflow.
Feature requests and feedback
-----------------------------

Do you like ecg? Share some love on Twitter or in your blog posts!
Do you like ecgtools? Share some love on Twitter or in your blog posts!

We'd also like to hear about your propositions and suggestions. Feel free to
`submit them as issues <https://github.com/NCAR/ecg>`_ and:
`submit them as issues <https://github.com/NCAR/ecgtools>`_ and:

* Explain in detail how they should work.
* Keep the scope as narrow as possible. This will make it easier to implement.
Expand All @@ -36,13 +36,13 @@ We'd also like to hear about your propositions and suggestions. Feel free to
Report bugs
-----------

Report bugs for ecg in the `issue tracker <https://github.com/NCAR/ecg>`_.
Report bugs for ecgtools in the `issue tracker <https://github.com/NCAR/ecgtools>`_.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting,
specifically the Python interpreter version, installed libraries, and ecg
specifically the Python interpreter version, installed libraries, and ecgtools
version.
* Detailed steps to reproduce the bug.

Expand All @@ -56,15 +56,15 @@ fix the bug itself.
Fix bugs
--------

Look through the `GitHub issues for bugs <https://github.com/NCAR/ecg/labels/type:%20bug>`_.
Look through the `GitHub issues for bugs <https://github.com/NCAR/ecgtools/labels/type:%20bug>`_.

Talk to developers to find out how you can fix specific bugs.


Write documentation
-------------------

ecg could always use more documentation. What exactly is needed?
ecgtools could always use more documentation. What exactly is needed?

* More complementary documentation. Have you perhaps found something unclear?
* Docstrings. There can never be too many of them.
Expand Down Expand Up @@ -93,21 +93,21 @@ Preparing Pull Requests


#. Fork the
`ecg GitHub repository <https://github.com/NCAR/ecg>`__. It's
fine to use ``ecg`` as your fork repository name because it will live
`ecgtools GitHub repository <https://github.com/NCAR/ecgtools>`__. It's
fine to use ``ecgtools`` as your fork repository name because it will live
under your user.

#. Clone your fork locally using `git <https://git-scm.com/>`_ and create a branch::

$ git clone git@github.com:YOUR_GITHUB_USERNAME/ecg.git
$ cd ecg
$ git clone git@github.com:YOUR_GITHUB_USERNAME/ecgtools.git
$ cd ecgtools
# now, to fix a bug or add feature create your own branch off "master":

$ git checkout -b your-bugfix-feature-branch-name master



#. Install `pre-commit <https://pre-commit.com>`_ and its hook on the ecg repo::
#. Install `pre-commit <https://pre-commit.com>`_ and its hook on the ecgtools repo::

$ pip install --user pre-commit
$ pre-commit install
Expand Down Expand Up @@ -144,8 +144,8 @@ Preparing Pull Requests

#. Finally, submit a pull request through the GitHub website using this data::

head-fork: YOUR_GITHUB_USERNAME/ecg
head-fork: YOUR_GITHUB_USERNAME/ecgtools
compare: your-branch-name

base-fork: NCAR/ecg
base-fork: NCAR/ecgtools
base: master
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include LICENSE
include README.rst

recursive-include ecg *.py
recursive-include ecgtools *.py
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.. image:: https://img.shields.io/github/workflow/status/NCAR/ecg/CI?logo=github&style=for-the-badge
:target: https://github.com/NCAR/ecg/actions
.. image:: https://img.shields.io/github/workflow/status/NCAR/ecgtools/CI?logo=github&style=for-the-badge
:target: https://github.com/NCAR/ecgtools/actions
:alt: GitHub Workflow CI Status

.. image:: https://img.shields.io/github/workflow/status/NCAR/ecg/code-style?label=Code%20Style&style=for-the-badge
:target: https://github.com/NCAR/ecg/actions
.. image:: https://img.shields.io/github/workflow/status/NCAR/ecgtools/code-style?label=Code%20Style&style=for-the-badge
:target: https://github.com/NCAR/ecgtools/actions
:alt: GitHub Workflow Code Style Status

.. image:: https://img.shields.io/codecov/c/github/NCAR/ecg.svg?style=for-the-badge
:target: https://codecov.io/gh/NCAR/ecg
.. image:: https://img.shields.io/codecov/c/github/NCAR/ecgtools.svg?style=for-the-badge
:target: https://codecov.io/gh/NCAR/ecgtools

ecg
===
ecgtools
========

Development
------------
Expand Down
6 changes: 4 additions & 2 deletions ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ channels:
- conda-forge
dependencies:
- codecov
- dask
- intake-esm
- nbsphinx
- netcdf4
- numpydoc
- pip
- pytest
- pytest-cov
- xarray
- numpydoc
- nbsphinx
6 changes: 4 additions & 2 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
numpydoc
sphinx-rtd-theme
pydata-sphinx-theme
nbsphinx
ipykernel
ipython
pandoc
-r ../requirements.txt
16 changes: 16 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. currentmodule:: ecgtools

#############
API reference
#############

This is a reference API class listing, and modules.

Builder Object
===============

.. autoclass:: Builder

.. automethod:: __init__
.. automethod:: parse_files_attributes
.. automethod:: create_catalog
35 changes: 19 additions & 16 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import os
import sys

import ecg
import ecgtools

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -41,15 +41,15 @@
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.extlinks',
'numpydoc',
'sphinx.ext.napoleon',
'IPython.sphinxext.ipython_console_highlighting',
'IPython.sphinxext.ipython_directive',
'nbsphinx',
]

extlinks = {
'issue': ('https://github.com/NCAR/ecg/issues/%s', 'GH#'),
'pr': ('https://github.com/NCAR/ecg/pull/%s', 'GH#'),
'issue': ('https://github.com/NCAR/ecgtools/issues/%s', 'GH#'),
'pr': ('https://github.com/NCAR/ecgtools/pull/%s', 'GH#'),
}

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -60,33 +60,36 @@

# Enable notebook execution
# https://nbsphinx.readthedocs.io/en/0.4.2/never-execute.html
# nbsphinx_execute = 'auto'
nbsphinx_execute = 'auto'
# Allow errors in all notebooks by
nbsphinx_allow_errors = True

# Disable cell timeout
nbsphinx_timeout = -1

autosummary_generate = []

# Otherwise, the Return parameter list looks different from the Parameters list
napoleon_use_rtype = False
# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'ecg'
project = 'ecgtools'
current_year = datetime.datetime.now().year
copyright = f'2020-{current_year}, NCAR XDev Team'
author = u'NCAR XDev Team'
author = 'NCAR XDev Team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ecg.__version__.split('+')[0]
version = ecgtools.__version__.split('+')[0]
# The full version, including alpha/beta/rc tags.
release = ecg.__version__
release = ecgtools.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -130,7 +133,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme = 'pydata_sphinx_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -203,7 +206,7 @@
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'ecgdoc'
htmlhelp_basename = 'ecgtoolsdoc'


# -- Options for LaTeX output --------------------------------------------------
Expand All @@ -220,7 +223,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'ecg.tex', u'ecg Documentation', u'NCAR XDev Team', 'manual'),
('index', 'ecgtools.tex', 'ecgtools Documentation', 'NCAR XDev Team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -248,7 +251,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [('index', 'ecg', u'ecg Documentation', [author], 1)]
man_pages = [('index', 'ecgtools', 'ecgtools Documentation', [author], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -262,10 +265,10 @@
texinfo_documents = [
(
'index',
'ecg',
u'ecg Documentation',
'ecgtools',
'ecgtools Documentation',
author,
'ecg',
'ecgtools',
'One line description of project.',
'Miscellaneous',
),
Expand Down
5 changes: 3 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Contents:
:maxdepth: 2

usage
api


Feedback
========


If you encounter any errors or problems with **ecg**,
please open an issue at the GitHub http://github.com/NCAR/ecg main repository.
If you encounter any errors or problems with **ecgtools**,
please open an issue at the GitHub http://github.com/NCAR/ecgtools main repository.
4 changes: 2 additions & 2 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Usage
========

To use ecg in a project::
To use ecgtools in a project::

import ecg
import ecgtools
26 changes: 0 additions & 26 deletions ecg/core.py

This file was deleted.

Loading

0 comments on commit e5108a4

Please sign in to comment.