From a0729c547e6368125be9e87a7e798da737f7fcf7 Mon Sep 17 00:00:00 2001 From: Joseph D Hughes Date: Sat, 21 Aug 2021 09:11:18 -0500 Subject: [PATCH 1/2] refactor(zonebud): reapply OrderedDict to dict changes from PR #1201 --- flopy/utils/zonbud.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flopy/utils/zonbud.py b/flopy/utils/zonbud.py index 6cc3d53ab4..3330ef6d9c 100644 --- a/flopy/utils/zonbud.py +++ b/flopy/utils/zonbud.py @@ -2,7 +2,6 @@ import copy import numpy as np from itertools import groupby -from collections import OrderedDict from .utils_def import totim_to_datetime @@ -152,7 +151,7 @@ def __init__( self.izone = izone self.allzones = np.unique(izone) - self._zonenamedict = OrderedDict( + self._zonenamedict = dict( [(z, "ZONE_{}".format(z)) for z in self.allzones] ) @@ -2200,7 +2199,7 @@ def __init__(self, model, izone, extension=".zon", aliases=None): self.filename = self._parent.name + extension self.aliases = aliases self.allzones = [int(zn) for zn in np.unique(izone) if zn != 0] - self._zonenamedict = OrderedDict( + self._zonenamedict = dict( [(zn, "ZONE_{}".format(zn)) for zn in self.allzones] ) From 7cb08b00828254eb6f5e255c7c138d7e71a54fe8 Mon Sep 17 00:00:00 2001 From: Joseph D Hughes Date: Sat, 21 Aug 2021 09:29:43 -0500 Subject: [PATCH 2/2] refactor(zonebud): reapply OrderedDict to dict changes from PR #1201 --- flopy/utils/zonbud.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/flopy/utils/zonbud.py b/flopy/utils/zonbud.py index 3330ef6d9c..7789821075 100644 --- a/flopy/utils/zonbud.py +++ b/flopy/utils/zonbud.py @@ -151,9 +151,7 @@ def __init__( self.izone = izone self.allzones = np.unique(izone) - self._zonenamedict = dict( - [(z, "ZONE_{}".format(z)) for z in self.allzones] - ) + self._zonenamedict = {z: "ZONE_{}".format(z) for z in self.allzones} if aliases is not None: s = ( @@ -2198,10 +2196,8 @@ def __init__(self, model, izone, extension=".zon", aliases=None): self._parent.add_package("zon", self) self.filename = self._parent.name + extension self.aliases = aliases - self.allzones = [int(zn) for zn in np.unique(izone) if zn != 0] - self._zonenamedict = dict( - [(zn, "ZONE_{}".format(zn)) for zn in self.allzones] - ) + self.allzones = [int(z) for z in np.unique(izone) if z != 0] + self._zonenamedict = {z: "ZONE_{}".format(z) for z in self.allzones} if aliases is not None: if not isinstance(aliases, dict):