diff --git a/conda_package/mpas_tools/__init__.py b/conda_package/mpas_tools/__init__.py index cfd74488f..a146677a5 100644 --- a/conda_package/mpas_tools/__init__.py +++ b/conda_package/mpas_tools/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = (0, 5, 0) +__version_info__ = (0, 5, 1) __version__ = '.'.join(str(vi) for vi in __version_info__) diff --git a/conda_package/mpas_tools/ocean/moc.py b/conda_package/mpas_tools/ocean/moc.py index d1d34f873..f90b3d97c 100755 --- a/conda_package/mpas_tools/ocean/moc.py +++ b/conda_package/mpas_tools/ocean/moc.py @@ -290,15 +290,13 @@ def _add_transects_to_moc(mesh, mocMask, southernBoundaryEdges, mocMask['transectVertexGlobalIDs'] = \ (('nTransects', 'maxVerticesInTransect'), transectVertexGlobalIDs) - mocMask['transectNames'] = mocMask.regionNames.rename( - {'nRegions': 'nTransects'}) - if 'nRegionsInGroup' not in mocMask: nRegions = mocMask.sizes['nRegions'] nRegionGroups = 2 nRegionsInGroup = nRegions*numpy.ones(nRegionGroups, dtype=int) regionsInGroup = numpy.zeros((nRegionGroups, nRegions), dtype=int) regionGroupNames = ['MOCBasinRegionsGroup', 'all'] + regionNames = mocMask.regionNames.values nChar = 64 for index in range(nRegionGroups): regionsInGroup[index, :] = numpy.arange(1, nRegions+1) @@ -315,6 +313,17 @@ def _add_transects_to_moc(mesh, mocMask, southernBoundaryEdges, for index in range(nRegionGroups): mocMask['regionGroupNames'][index] = regionGroupNames[index] + # we need to make sure the region names use the same string length + mocMask['regionNames'] = \ + (('nRegions',), numpy.zeros((nRegions,), + dtype='|S{}'.format(nChar))) + + for index in range(nRegions): + mocMask['regionNames'][index] = regionNames[index] + + mocMask['transectNames'] = mocMask.regionNames.rename( + {'nRegions': 'nTransects'}) + mocMask['nTransectsInGroup'] = mocMask.nRegionsInGroup.rename( {'nRegionGroups': 'nTransectGroups'}) diff --git a/conda_package/recipe/meta.yaml b/conda_package/recipe/meta.yaml index 95285d86c..cc86cba19 100644 --- a/conda_package/recipe/meta.yaml +++ b/conda_package/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "mpas_tools" %} -{% set version = "0.5.0" %} +{% set version = "0.5.1" %} package: name: {{ name|lower }}