Skip to content

Commit 1770326

Browse files
EliEli
authored andcommitted
Fixed versioning and did a one liner that prevents documentation generation.
1 parent 569bbe7 commit 1770326

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

schimpy/__init__.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
"""Top-level package for schimpy."""
2-
31
__author__ = """Eli Ateljevich, Kijin Nam"""
42
__email__ = "Eli.Ateljevich@water.ca.gov; Kijin.Nam@water.ca.gov"
53

64
try:
7-
from ._version import __version__
5+
from importlib.metadata import version, PackageNotFoundError
86
except ImportError:
9-
__version__ = "0.0.0" # fallback for weird dev cases
7+
from pkg_resources import get_distribution, DistributionNotFound
8+
def version(pkg): return get_distribution(pkg).version
9+
PackageNotFoundError = DistributionNotFound
10+
11+
try:
12+
__version__ = version("schimpy")
13+
except PackageNotFoundError:
14+
# Fallback for running from a VCS checkout without installation
15+
try:
16+
from setuptools_scm import get_version
17+
__version__ = get_version(root="..", relative_to=__file__)
18+
except Exception:
19+
__version__ = "unknown"

schimpy/model_time.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ def file_to_elapsed(infile, start, outpath=None, annotate=False, skip_nan=False)
270270
prev_use = False
271271
prev_outline = None
272272
no_record = True
273-
<<<<<<< HEAD
274273
for iline, line in enumerate(thfile):
275274
if (
276275
line
@@ -281,12 +280,6 @@ def file_to_elapsed(infile, start, outpath=None, annotate=False, skip_nan=False)
281280
or line.startswith("time")
282281
)
283282
):
284-
=======
285-
286-
287-
for iline,line in enumerate(thfile):
288-
if line and len(line) > 1 and not (line.startswith("#") or line.startswith("date") or line.startswith("time")):
289-
>>>>>>> ad36b55 (caching for stacked_dem_fill.py , bug fix on date formats for model_time.py, accelerate laplace_smooth_data.py, optimized raster_to_nodes.py)
290283
splitline = line.split()
291284
if skip_nan and splitline[-1] == "nan":
292285
continue

0 commit comments

Comments
 (0)