Skip to content

Commit ec97e4b

Browse files
committed
Fix hard coded values and add conda libraries preferentially during devtask run
1 parent 74ef171 commit ec97e4b

File tree

2 files changed

+51
-35
lines changed

2 files changed

+51
-35
lines changed

scripts/Zhu2012_param.txt

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -474,34 +474,34 @@ SUCS::MOD::Km603 0.28 # [Km603] Matches default C3 va
474474
SUCS::MOD::Km604 16.0 # [Km604] Matches default C3 value
475475
SUCS::MOD::KE60 16.0 # [KE60] Matches default C3 value
476476
SUCS::MOD::ATPc 0.35 # [ATPc] Matches default C3 value
477-
Em_GADPH -0.34 # [Em_GADPH] No match
478-
Em_RuACT -0.295 # [Em_RuACT] No match
479-
Em_ADPGPP -0.29 # [Em_ADPGPP] No match
480-
Em_Fd -0.42 # [Em_Fd] No match
481-
Em_Thiof -0.29 # [Em_Thiof] No match
482-
Em_CytbL -0.09 # [Em_CytbL] No match
483-
Em_CytbH 0.05 # [Em_CytbH] No match
484-
kdmo 56000000.0 # [kdmo] No match
485-
ISPH 0.0 # [ISPH] No match
486-
Rubisco 1072.0 # [Rubisco] No match
487-
PC 1.0 # [PC] No match
488-
A0 1.0 # [A0] No match
489-
NADP 0.79 # [NADP] No match
490-
E.bL.bH 1.0 # [E.bL.bH] No match
491-
E.bL.bH.ISPox.PQH2 0.0 # [E.bL.bH.ISPox.PQH2] No match
492-
E.bL.bH.PQH· 0.0 # [E.bL.bH.PQH·] No match
493-
ISPH+ox 1.0 # [ISPH+ox] No match
494-
E.bL--bH 0.0 # [E.bL­-bH] No match
495-
E.bL.bH- 0.0 # [E.bL.bH-] No match
496-
H+ 0.0001 # [H+] No match
497-
PQ 1.0 # [PQ] No match
498-
QH 0.031 # [QH] No match
499-
Hfl 0.0001 # [Hfl] No match
500-
Hfs 0.0001 # [Hfs] No match
501-
Netcharge 0.0 # [Netcharge] No match
502-
DY 0.0 # [DY] No match
503-
NADH 0.22 # [NADH] No match
504-
NAD 0.08 # [NAD] No match
505-
Pic 5.0 # [Pic] No match
506-
TPc 2.3 # [TPc] No match
507-
UDPG 0.6 # [UDPG] No match
477+
# Em_GADPH -0.34 # [Em_GADPH] No match
478+
# Em_RuACT -0.295 # [Em_RuACT] No match
479+
# Em_ADPGPP -0.29 # [Em_ADPGPP] No match
480+
# Em_Fd -0.42 # [Em_Fd] No match
481+
# Em_Thiof -0.29 # [Em_Thiof] No match
482+
# Em_CytbL -0.09 # [Em_CytbL] No match
483+
# Em_CytbH 0.05 # [Em_CytbH] No match
484+
# kdmo 56000000.0 # [kdmo] No match
485+
# ISPH 0.0 # [ISPH] No match
486+
# Rubisco 1072.0 # [Rubisco] No match
487+
# PC 1.0 # [PC] No match
488+
# A0 1.0 # [A0] No match
489+
# NADP 0.79 # [NADP] No match
490+
# E.bL.bH 1.0 # [E.bL.bH] No match
491+
# E.bL.bH.ISPox.PQH2 0.0 # [E.bL.bH.ISPox.PQH2] No match
492+
# E.bL.bH.PQH· 0.0 # [E.bL.bH.PQH·] No match
493+
# ISPH+ox 1.0 # [ISPH+ox] No match
494+
# E.bL--bH 0.0 # [E.bL­-bH] No match
495+
# E.bL.bH- 0.0 # [E.bL.bH-] No match
496+
# H+ 0.0001 # [H+] No match
497+
# PQ 1.0 # [PQ] No match
498+
# QH 0.031 # [QH] No match
499+
# Hfl 0.0001 # [Hfl] No match
500+
# Hfs 0.0001 # [Hfs] No match
501+
# Netcharge 0.0 # [Netcharge] No match
502+
# DY 0.0 # [DY] No match
503+
# NADH 0.22 # [NADH] No match
504+
# NAD 0.08 # [NAD] No match
505+
# Pic 5.0 # [Pic] No match
506+
# TPc 2.3 # [TPc] No match
507+
# UDPG 0.6 # [UDPG] No match

scripts/devtasks.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def write_param_table(fname, param, title=None):
192192
param.to_csv(fd, index=False)
193193

194194

195-
def write_param(fname, param, sort=False):
195+
def write_param(fname, param, sort=False, comment_incomplete=False):
196196
maxlen = len(max(param.keys(), key=len)) + 4
197197
maxlen_value = len(
198198
max([f'{v["value"]}' if isinstance(v, dict) else f'{v}'
@@ -229,6 +229,8 @@ def get_sortkey(x):
229229
value = v.value
230230
if v.comment:
231231
comment += v.comment
232+
if comment_incomplete and not v.is_complete:
233+
k = f'# {k}'
232234
else:
233235
value = v
234236
vstr = f'{value}'
@@ -481,8 +483,17 @@ def __init__(self, args, **kwargs):
481483
self.adjust_args(args)
482484
kwargs.setdefault('cwd', args.build_dir)
483485
kwargs.setdefault('env', {})
486+
add_dirs = [args.build_dir]
487+
if os.environ.get('CONDA_PREFIX'):
488+
conda_prefix = os.environ['CONDA_PREFIX']
489+
if sys.platform in ['win32', 'cygwin']:
490+
conda_prefix = os.path.join(
491+
conda_prefix, 'Library', 'lib')
492+
else:
493+
conda_prefix = os.path.join(conda_prefix, 'lib')
494+
add_dirs.append(conda_prefix)
484495
kwargs['env'][_library_path_var] = add_directory_to_path(
485-
args.build_dir, return_path=True, prepend=True,
496+
add_dirs, return_path=True, prepend=True,
486497
prev_value=kwargs['env'].get(_library_path_var, None),
487498
)
488499
super(BuildSubTask, self).__init__(args, **kwargs)
@@ -1547,7 +1558,8 @@ def run_commands(self, args, **kwargs):
15471558
for k, v in existing.items():
15481559
v.finalize(defaults=defaults, existing=existing,
15491560
aliases=aliases)
1550-
write_param(args.param_file, existing, sort=args.sort_param)
1561+
write_param(args.param_file, existing, sort=args.sort_param,
1562+
comment_incomplete=(not args.include_missing))
15511563
print(f"WROTE {args.param_file}")
15521564

15531565
@classmethod
@@ -1725,7 +1737,6 @@ def adjust_args(cls, args):
17251737
'ALL::VARS::TestLi': 'umol m**-2 s**-1',
17261738
}
17271739
if args.light_profile.startswith('Zhu2012'):
1728-
args.match_limits = True
17291740
args.evn_file = None
17301741
args.param.update(
17311742
O2_cond=0.210, # mmol mol-1
@@ -1923,6 +1934,7 @@ def plot(self, data):
19231934
ax.set_ylabel(f'A ({args.plot_units["CO2AR"]})')
19241935
ax.plot(data['ALL::VARS::TestLi'], data['CO2AR'])
19251936
if args.plot_file:
1937+
print(f'Saving plot to \"{args.plot_file}\"')
19261938
fig.savefig(args.plot_file)
19271939
else:
19281940
plt.show()
@@ -2252,6 +2264,10 @@ def __init__(self, args, **kwargs):
22522264
'--inspect-missing', action='store_true',
22532265
help=('Step through parameters that don\'t have an assigned '
22542266
'version for the C++ code'))
2267+
parser_zhu2012.add_argument(
2268+
'--include-missing', action='store_true',
2269+
help=('Include parameters that don\'t have an assigned '
2270+
'version for the C++ code'))
22552271
parser_ephoto = subparsers.add_parser(
22562272
'ephoto', help="Run ephoto executable",
22572273
func=ephoto)

0 commit comments

Comments
 (0)