Skip to content

Commit

Permalink
Merge branch 'release/0.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjun Chennu committed Dec 19, 2019
2 parents 6d3f764 + 5155c03 commit 2895564
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.13
current_version = 0.14
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
# the built documents.
#
# The short X.Y version.
version = "0.13"
version = "0.14"
# The full version, including alpha/beta/rc tags.
release = "0.13"
release = "0.14"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion microbenthos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

__author__ = """Arjun Chennu"""
__email__ = '[email protected]'
__version__ = '0.13'
__version__ = '0.14'

import logging

Expand Down
17 changes: 14 additions & 3 deletions microbenthos/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import click
from pathlib import Path
from . import __version__

try:
import click_completion
Expand Down Expand Up @@ -173,6 +174,7 @@ def _simtime_total_callback(ctx, param, value):
@click.option('--logger',
help='Set specified logger to loglevel (example: microbenthos.model 20)',
multiple=True, type=(str, click.IntRange(10, 40)))
@click.version_option(version=__version__)
def cli(verbosity, logger):
"""Console entry point for microbenthos"""
loglevel = 0
Expand Down Expand Up @@ -288,6 +290,11 @@ def cli_simulate(model_file, output_dir, exporter, overwrite, compression,
click.echo('Loading model from {}'.format(model_file))
with open(model_file, 'r') as fp:
defs = yaml.unsafe_load(fp)

if 'model' not in defs and 'domain' in defs:
# model is not under a separate key, so insert it under "model"
defs = dict(model=defs)

if 'simulation' not in defs:
defs['simulation'] = {}

Expand Down Expand Up @@ -475,7 +482,8 @@ def export_video(datafile, outfile, overwrite,

@export.command('model')
@click.argument('model_file', type=click.File())
@click.option('--key', help='Load this key from the input file')
@click.option('--key', help='Load this key from the input file',
default="model")
@click.option('-v', '--verbose', is_flag=True, default=False,
help='Set this to see verbose output')
def export_model(model_file, key, verbose):
Expand All @@ -502,9 +510,12 @@ def export_model(model_file, key, verbose):
from pprint import pformat
if verbose:
click.secho('Validated dictionary!', fg='green')

model_definition = dict(model=valid)
click.secho(
yaml.dump(valid, indent=4, explicit_start=True, explicit_end=True),
yaml.dump(model_definition,
indent=4,
explicit_start=True,
explicit_end=True),
fg='yellow')

except ValueError:
Expand Down
5 changes: 3 additions & 2 deletions microbenthos/dataview/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,10 @@ def update_irradiance(self):
self.logger.debug('No irradiance info found')

else:

# load irradiance cycle info
linfo = dict(irradiance.attrs)
# irradiance might be hdf.Dataset or a dict
linfo = dict(getattr(irradiance, 'attrs',
irradiance['metadata']))
self.diel_period = PhysicalField(linfo['hours_total'])
self.diel_zenith = PhysicalField(linfo['zenith_time'])

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_description():

setup(
name='microbenthos',
version='0.13',
version='0.14',
description= \
"Modeling framework for microbenthic habitats useful for studies in "
"biogeochemistry and marine microbial ecology.",
Expand Down

0 comments on commit 2895564

Please sign in to comment.