Skip to content

Commit

Permalink
fixing version finding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lukegre committed Apr 17, 2020
1 parent c3a2239 commit a5fa295
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ repos:
rev: 19.10b0
hooks:
- id: black
args: ["-v", "--line-length", "79", "--skip-string-normalization", "--exclude", "flo_functions", '--exclude', "__init__.py"]
args: ["-v", "--line-length", "79", "--skip-string-normalization", "--exclude", "flo_functions.py", "--exclude", "__init__.py"]

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
args: ["-w", "79", "-s", "__init__.py"]
args: ["-w", "79", "-sg", "__init__.py", "-m", "3", "-tc"]

# - repo: https://github.com/PyCQA/doc8
# rev: 0.8.1rc2
Expand Down
2 changes: 0 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
setuptools
setuptools_scm
21 changes: 16 additions & 5 deletions glidertools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@

import warnings as _warnings

from setuptools_scm import get_version
from pkg_resources import DistributionNotFound, get_distribution

from . import (calibration, cleaning, flo_functions, load, mapping, optics,
physics, utils)
from . import ( # NOQA
calibration,
cleaning,
flo_functions,
load,
mapping,
optics,
physics,
utils,
)
from .mapping import grid_data, interp_obj
from .plot import logo as make_logo
from .plot import plot_functions as plot
from .processing import *

__version__ = get_version(root='..', relative_to=__file__)
del get_version
try:
__version__ = get_distribution('glidertools').version
except DistributionNotFound:
__version__ = 'version_undefined'
del get_distribution, DistributionNotFound

_warnings.filterwarnings('ignore', category=RuntimeWarning)
4 changes: 3 additions & 1 deletion glidertools/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
from __future__ import print_function as _pf
from __future__ import unicode_literals as _ul

from inspect import currentframe as getframe

import numpy as _np

from .helpers import getframe, transfer_nc_attrs
from .helpers import transfer_nc_attrs


def bottle_matchup(
Expand Down
4 changes: 3 additions & 1 deletion glidertools/cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from __future__ import print_function as _pf
from __future__ import unicode_literals as _ul

from .helpers import getframe, transfer_nc_attrs
from inspect import currentframe as getframe

from .helpers import transfer_nc_attrs


def outlier_bounds_std(arr, multiplier=3):
Expand Down
9 changes: 5 additions & 4 deletions glidertools/helpers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import inspect
from inspect import currentframe as getframe

from setuptools_scm import get_version
from pkg_resources import DistributionNotFound, get_distribution

version = get_version(root='..', relative_to=__file__)
del get_version
try:
version = get_distribution('glidertools').version
except DistributionNotFound:
version = 'version_undefined'


class GliderToolsWarning(UserWarning):
Expand Down
4 changes: 3 additions & 1 deletion glidertools/mapping.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from inspect import currentframe as getframe

import numpy as np
from matplotlib import pyplot as plt
from numexpr import evaluate

from .helpers import GliderToolsWarning, getframe, transfer_nc_attrs
from .helpers import GliderToolsWarning, transfer_nc_attrs


class QuadTree:
Expand Down
4 changes: 3 additions & 1 deletion glidertools/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from __future__ import print_function as _pf
from __future__ import unicode_literals as _ul

from .helpers import getframe, transfer_nc_attrs
from inspect import currentframe as getframe

from .helpers import transfer_nc_attrs


def find_bad_profiles(
Expand Down
3 changes: 2 additions & 1 deletion glidertools/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from __future__ import unicode_literals as _ul

import warnings
from inspect import currentframe as getframe

from .helpers import GliderToolsWarning, getframe, transfer_nc_attrs
from .helpers import GliderToolsWarning, transfer_nc_attrs

try:
_gsw_avail = True
Expand Down
4 changes: 3 additions & 1 deletion glidertools/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from __future__ import print_function as _pf
from __future__ import unicode_literals as _ul

from .helpers import getframe, printv, transfer_nc_attrs
from inspect import currentframe as getframe

from .helpers import printv, transfer_nc_attrs


def calc_physics(
Expand Down
4 changes: 3 additions & 1 deletion glidertools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from __future__ import print_function as _pf
from __future__ import unicode_literals as _ul

from .helpers import getframe, transfer_nc_attrs
from inspect import currentframe as getframe

from .helpers import transfer_nc_attrs


def time_average_per_dive(dives, time):
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ pandas
astral
netCDF4
numexpr
setuptools_scm

0 comments on commit a5fa295

Please sign in to comment.