Skip to content

Commit

Permalink
chore: add a lot of infrastructure files
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-murray committed May 22, 2020
1 parent bdea389 commit fa8de6e
Show file tree
Hide file tree
Showing 9 changed files with 355 additions and 320 deletions.
36 changes: 36 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[flake8]
ignore =
E203
E266
E501
W503
F403
F401
E231
max-line-length = 88
# Should be 18.
max-complexity = 25
exclude =
development/*
# Not ready for this yet.
per-file-ignores =
scripts/hmf: F821
scripts/hmf-fit: F821
select = B,C,E,F,W,T4,B9,D
rst-roles =
class
func
mod
data
const
meth
attr
exc
obj
rst-directives =
note
warning
versionadded
versionchanged
deprecated
seealso
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
exclude: '^docs/conf.py'

repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: check-merge-conflict
- id: mixed-line-ending
args: ['--fix=no']
- repo: https://gitlab.com/pycqa/flake8
rev: '3.8.1' # pick a git hash / tag to point to
hooks:
- id: flake8
additional_dependencies:
- flake8-rst-docstrings
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.5.1
hooks:
- id: rst-backticks
1 change: 0 additions & 1 deletion hera_sim/VERSION

This file was deleted.

18 changes: 13 additions & 5 deletions hera_sim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
try:
from importlib.metadata import version, PackageNotFoundError
except ImportError:
from importlib_metadata import version, PackageNotFoundError

try:
__version__ = version(__name__)
except PackageNotFoundError:
print("package not found")
# package is not installed
pass

from . import __yaml_constructors
from . import antpos
from . import foregrounds
Expand All @@ -7,16 +19,12 @@
from . import rfi
from . import sigchain
from hera_sim.visibilities import simulators
from . import version
from . import eor
from . import utils
from . import simulate
from .cli import run # for testing purposes
from .cli import run # for testing purposes
from .simulate import Simulator
from .defaults import defaults
from .components import SimulationComponent, registry
from .components import list_discoverable_components
from .interpolators import Tsky, Bandpass, Beam

__version__ = version.version

Loading

0 comments on commit fa8de6e

Please sign in to comment.