Skip to content

Commit

Permalink
Implemented Duncan's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Goetz committed Nov 1, 2023
1 parent 574e1ba commit ac3b038
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include LICENSE README.rst MANIFEST.in
include gwsumm/_version.py
recursive-include share *.ini
include gwsumm/config/*.ini
15 changes: 8 additions & 7 deletions gwsumm/config.py → gwsumm/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@
from gwpy.detector import (Channel, ChannelList)
from gwpy.time import tconvert

from .channels import (get_channels, split as split_channels,
update_channel_params)
from .html import (get_css, get_js)
from .utils import (nat_sorted, re_cchar, re_quote, safe_eval, OBSERVATORY_MAP)
from ..channels import (get_channels, split as split_channels,
update_channel_params)
from ..html import (get_css, get_js)
from ..utils import (nat_sorted, re_cchar, re_quote, safe_eval,
OBSERVATORY_MAP)

__all__ = [
'GWSummConfigParser',
]

CONFIGDIR = os.path.join(os.path.dirname(__file__), '..', 'share')
CONFIGDIR = os.path.dirname(__file__)


# -- class definitions --------------------------------------------------------
Expand Down Expand Up @@ -304,8 +305,8 @@ def load_states(self, section='states'):
"""Read and format a list of `SummaryState` definitions from the
given :class:`~configparser.ConfigParser`
"""
from .state import (register_state, SummaryState,
ALLSTATE, generate_all_state, get_state)
from ..state import (register_state, SummaryState,
ALLSTATE, generate_all_state, get_state)
# parse the [states] section into individual state definitions
try:
states = dict(self.nditems(section))
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 1 addition & 8 deletions gwsumm/tabs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

from gwdetchar.io import html as gwhtml

from .. import __version__
from .. import html
from ..mode import (Mode, get_mode, get_base)
from ..utils import (re_quote, re_cchar)
Expand All @@ -55,14 +56,6 @@


def get_version():
try:
from ._version import version as __version__
except ModuleNotFoundError:
try:
import setuptools_scm
__version__ = setuptools_scm.get_version(fallback_version='?.?.?')
except (ModuleNotFoundError, TypeError, LookupError):
__version__ = '?.?.?'
return __version__

Check warning on line 59 in gwsumm/tabs/core.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/tabs/core.py#L59

Added line #L59 was not covered by tests


Expand Down
2 changes: 1 addition & 1 deletion gwsumm/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_init(self):
assert cp._dict is OrderedDict

def test_configdir(self):
assert set(os.listdir(config.CONFIGDIR)) == {
assert set(os.listdir(config.CONFIGDIR)) >= {
'defaults.ini',
'matplotlib.ini',
}
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ requires-python = ">=3.9"
authors = [
{ name = "Alex Urban", email = "[email protected]" },
{ name = "Duncan Macleod", email = "[email protected]" },
]
maintainers = [
{ name = "Evan Goetz", email = "[email protected]" },
]
license = { text = "GPL-3.0-or-later" }
Expand Down Expand Up @@ -89,6 +91,7 @@ gwsumm-plot-triggers = "gwsumm.plot.triggers.__main__:main"

[tool.setuptools]
license-files = [ "LICENSE" ]
include-package-data = true

[tool.setuptools.packages.find]
include = [ "gwsumm*" ]
Expand Down

0 comments on commit ac3b038

Please sign in to comment.