Skip to content

Commit

Permalink
continue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
schumannj committed Nov 12, 2024
1 parent 24ed88c commit 2308d4d
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/nomad_catalysis/schema_packages/catalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def map_and_assign_attributes(self, logger, mapping, target, obj=None) -> None:
the archive results."""
)
if threshold_datapoints < len(value) < threshold2_datapoints:
value = value[::10]
value = value[20::10]
else:
value = value[50::100]
except TypeError:
Expand Down Expand Up @@ -2230,7 +2230,7 @@ def check_react(self, react, threshold_datapoints, archive, logger):
if len(getattr(react, key1)) > threshold2_datapoints:
setattr(react, key, getattr(react, key)[50::100])
else:
setattr(react, key, getattr(react, key)[50::10])
setattr(react, key, getattr(react, key)[20::10])

break
return react
Expand Down Expand Up @@ -2326,7 +2326,10 @@ def write_products_results(
space_time_yield=i.space_time_yield,
)
if i.selectivity is not None and len(i.selectivity) > threshold_datapoints:
prod.selectivity = i.selectivity[50::100]
if threshold2_datapoints > len(i.selectivity):
prod.selectivity = i.selectivity[20::10]
else:
prod.selectivity = i.selectivity[50::100]
logger.info(
f"""Large arrays in product {i.name}, reducing to store
in the archive."""
Expand All @@ -2335,12 +2338,18 @@ def write_products_results(
i.gas_concentration_out is not None
and len(i.gas_concentration_out) > threshold_datapoints
):
prod.gas_concentration_out = i.gas_concentration_out[50::100]
if threshold2_datapoints > len(i.gas_concentration_out):
prod.gas_concentration_out = i.gas_concentration_out[20::10]
else:
prod.gas_concentration_out = i.gas_concentration_out[50::100]
if (
i.space_time_yield is not None
and len(i.space_time_yield) > threshold_datapoints
):
prod.space_time_yield = i.space_time_yield[50::100]
if threshold2_datapoints > len(i.space_time_yield):
prod.space_time_yield = i.space_time_yield[20::10]
else:
prod.space_time_yield = i.space_time_yield[50::100]

product_results.append(prod)

Expand Down

0 comments on commit 2308d4d

Please sign in to comment.