Skip to content

Commit

Permalink
tidy up init
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed May 15, 2021
1 parent 369bfdb commit 4e8119a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ repos:
hooks:
- id: flake8
args: ['--count', '--select', 'E101,E11,E111,E112,E113,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E133,E20,E211,E231,E241,E242,E251,E252,E26,E265,E266,E27,E301,E302,E303,E304,E305,E306,E401,E402,E502,E701,E711,E712,E713,E714,E722,E731,E901,E902,F822,F823,W191,W291,W292,W293,W391,W601,W602,W603,W604,W605,W690']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md)$"
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|drms/__init__.py)$"
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py)$"
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py|drms/__init__.py)$"
- repo: https://github.com/timothycrosley/isort
rev: 5.8.0
hooks:
- id: isort
args: ['--sp','setup.cfg']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py|drms/__init__.py)$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
]

# -- Sphinx Gallery ------------------------------------------------------------
from sphinx_gallery.sorting import ExampleTitleSortKey # NOQA
from sphinx_gallery.sorting import ExampleTitleSortKey

sphinx_gallery_conf = {
'backreferences_dir': os.path.join('generated', 'modules'),
Expand Down
35 changes: 27 additions & 8 deletions drms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,29 @@
drms
====
Access HMI, AIA and MDI data with Python
The drms library provides an easy-to-use interface for accessing HMI, AIA and MDI data with Python.
It uses the publicly accessible JSOC DRMS server by default, but can also be used with local NetDRMS sites.
More information, including a detailed tutorial, is available in the Documentation.
* Homepage: https://github.com/sunpy/drms
* Documentation: https://docs.sunpy.org/projects/drms/en/stable/
"""

import os
import sys

# Enforce Python version check during package import.
# Must be done before any drms imports
__minimum_python_version__ = "3.7"

class UnsupportedPythonError(Exception):
"""Running on an unsupported version of Python."""

from .client import * # NOQA
from .config import * # NOQA
from .exceptions import * # NOQA
from .json import * # NOQA
from .utils import * # NOQA
from .version import version as __version__ # NOQA

if sys.version_info < tuple(int(val) for val in __minimum_python_version__.split('.')):
# This has to be .format to keep backwards compatibly.
raise UnsupportedPythonError(
"sunpy does not support Python < {}".format(__minimum_python_version__))


def _get_bibtex():
Expand All @@ -31,5 +43,12 @@ def _get_bibtex():
ref = textwrap.dedent('\n'.join(lines))
return ref


__citation__ = __bibtex__ = _get_bibtex()

from .version import version as __version__
# DRMS imports to collapse the namespace
from .client import *
from .config import *
from .exceptions import *
from .json import *
from .utils import *

0 comments on commit 4e8119a

Please sign in to comment.