Skip to content

Commit b3e34af

Browse files
committed
Bump loam to 0.4.0
1 parent ec68f7a commit b3e34af

File tree

4 files changed

+16
-23
lines changed

4 files changed

+16
-23
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
include_package_data=True,
3434
install_requires=[
35-
'loam>=0.3.1',
35+
'loam>=0.4.0',
3636
'f90nml>=1.3.1',
3737
'setuptools_scm>=6.2',
3838
'numpy>=1.19',

stagpy/args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def parse_args(arglist=None):
5555

5656
create_complete_files(climan, CONFIG_DIR, 'stagpy', zsh_sourceable=True)
5757

58-
cmd_args, all_subs = climan.parse_args(arglist)
58+
cmd_args = climan.parse_args(arglist)
5959
sub_cmd = cmd_args.loam_sub_name
6060

6161
if sub_cmd is None:
@@ -68,7 +68,7 @@ def parse_args(arglist=None):
6868
set_conf_str(conf, conf.common.set)
6969

7070
if conf.common.config:
71-
commands.config_pp(all_subs)
71+
commands.config_pp(climan.sections_list(sub_cmd))
7272

7373
load_mplstyle()
7474

stagpy/config.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import pathlib
99

1010
from loam.manager import ConfOpt as Conf
11-
from loam.tools import switch_opt, config_conf_section, set_conf_opt
11+
from loam import tools
12+
from loam.tools import switch_opt, command_flag
1213

1314

1415
def _slice_or_int(arg):
@@ -45,9 +46,8 @@ def parser(arg):
4546
CONF_DEF = OrderedDict()
4647

4748
CONF_DEF['common'] = OrderedDict((
48-
('config', Conf(None, True, None, {'action': 'store_true'},
49-
False, 'print config options')),
50-
('set', set_conf_opt()),
49+
('config', command_flag(None, 'print config options')),
50+
('set', tools.set_conf_opt()),
5151
))
5252

5353
CONF_DEF['core'] = OrderedDict((
@@ -215,16 +215,11 @@ def parser(arg):
215215
))
216216

217217
CONF_DEF['var'] = OrderedDict((
218-
('field', Conf(None, True, None, {'action': 'store_true'},
219-
False, 'print field variables')),
220-
('sfield', Conf(None, True, None, {'action': 'store_true'},
221-
False, 'print surface field variables')),
222-
('rprof', Conf(None, True, None, {'action': 'store_true'},
223-
False, 'print rprof variables')),
224-
('time', Conf(None, True, None, {'action': 'store_true'},
225-
False, 'print time variables')),
226-
('refstate', Conf(None, True, None, {'action': 'store_true'},
227-
False, 'print refstate variables')),
218+
('field', command_flag(None, 'print field variables')),
219+
('sfield', command_flag(None, 'print surface field variables')),
220+
('rprof', command_flag(None, 'print rprof variables')),
221+
('time', command_flag(None, 'print time variables')),
222+
('refstate', command_flag(None, 'print refstate variables')),
228223
))
229224

230-
CONF_DEF['config'] = config_conf_section()
225+
CONF_DEF['config'] = tools.config_conf_section()

stagpy/plates.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,10 @@ def plot_scalar_field(snap, fieldname):
293293
c_field = np.ma.masked_where(
294294
~_continents_location(snap, at_surface=False),
295295
snap.fields['c'].values[0, :, :, 0])
296-
cbar = conf.field.colorbar
297-
conf.field.colorbar = False
298296
cmap = colors.ListedColormap(["k", "g", "m"])
299-
field.plot_scalar(snap, 'c', c_field, axis, cmap=cmap,
300-
norm=colors.BoundaryNorm([2, 3, 4, 5], cmap.N))
301-
conf.field.colorbar = cbar
297+
with conf.field.context_(colorbar=False):
298+
field.plot_scalar(snap, 'c', c_field, axis, cmap=cmap,
299+
norm=colors.BoundaryNorm([2, 3, 4, 5], cmap.N))
302300

303301
# plotting velocity vectors
304302
field.plot_vec(axis, snap, 'sx' if conf.plates.stress else 'v')

0 commit comments

Comments
 (0)