Skip to content

Commit c38168b

Browse files
committed
fixes #295. Also fixes small bug with get_filelikes() tripping over UNSET values
1 parent 9d3bedc commit c38168b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

scabha/basetypes.py

+3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ def get_filelikes(dtype, value, filelikes=None):
142142

143143
filelikes = set() if filelikes is None else filelikes
144144

145+
if value is UNSET or type(value) is UNSET:
146+
return []
147+
145148
origin = get_origin(dtype)
146149
args = get_args(dtype)
147150

stimela/config.py

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from omegaconf.omegaconf import MISSING, OmegaConf
77
from omegaconf.errors import OmegaConfBaseException
88
from collections import OrderedDict
9+
import psutil
910

1011
from yaml.error import YAMLError
1112
import stimela
@@ -268,9 +269,12 @@ def _load(conf, config_file):
268269
runtime = dict(
269270
date=_ds,
270271
time=_ts, datetime=f"{_ds}-{_ts}",
272+
ncpu=psutil.cpu_count(logical=True),
271273
node=platform.node().split('.', 1)[0],
272274
hostname=platform.node(),
273275
env={key: value.replace('${', '\${') for key, value in os.environ.items()})
276+
runtime['ncpu-logical'] = psutil.cpu_count(logical=True)
277+
runtime['ncpu-physical'] = psutil.cpu_count(logical=False)
274278

275279
conf.run = OmegaConf.create(runtime)
276280

0 commit comments

Comments
 (0)