Skip to content

generic_splitter not functioning properly in prescribed_commodity mode #616

@jmartin4u

Description

@jmartin4u

generic_splitter not functioning properly in prescribed_commodity mode

When the generic_splitter is used in prescribed_commodity mode with a connected <commodity_in> input, the value of the input "prescribed_commodity_to_priority_tech" is not being preserved from the setup() to the compute() step. This input appears to be set properly in setup() to be an array with all values equal to the value of the config parameter prescribed_commodity_to_priority_tech, but then in compute(), it is mysteriously always changing back to an array of ones.

How to reproduce

I set of a branch to reproduce this issue, since it occurred when running the ammonia synloop in a different repo. In the branch "splitter-bad2", if you run the example examples/12_ammonia_synloop/run_ammonia_synloop.py, I have set up print statements to show the mean values of the prescribed_commodity_to_priority_tech during both the setup() and compute(). Running this shows how the array changes back to ones at some point, which causes ammonia production to be severely limited (only 1 MW of electricity is passed to ammonia production, and it needs more).

Image

I have ALSO created a branch which fixes the problem, called "splitter-fix2". Running the same example, the prescribed_commodity_to_priority_tech value is now being preserved in compute(). I'm not sure why this fixes it, but the input has to be shaped using shape=n_timestamps rather than shape_by_conn in the setup():

Image

With this change, the splitter is working properly and much more sensible LCOAs are being calculated:

Image

System Information

  • OS: <Win 11 24H2>
  • Python version: <3.11.15>
  • H2Integrate version: <0.7.1>
    • Installed from source using an editable installation with developer tools: pip install -e .[develop]

Relevant library versions

absl-py==2.4.0
accessible-pygments==0.0.5
affine==2.4.0
aiobotocore==3.3.0
aiohappyeyeballs==2.6.1
aiohttp==3.13.3
aioitertools==0.13.0
aiosignal==1.4.0
alabaster==0.7.16
annotated-doc==0.0.4
annotated-types==0.7.0
anyio==4.12.1
ard-nrel==0.1.0b4
argon2-cffi==25.1.0
argon2-cffi-bindings==25.1.0
arrow==1.4.0
asttokens==3.0.1
async-lru==2.2.0
attrs==25.4.0
autograd==1.8.0
babel==2.18.0
beautifulsoup4==4.14.3
bidict==0.23.1
bitarray==3.8.0
bleach==6.3.0
botocore==1.42.70
cattrs==26.1.0
certifi==2026.2.25
cffi==1.17.1
cfgv==3.5.0
cftime==1.6.5
charset-normalizer==3.4.6
click==8.3.1
click-plugins==1.1.1.2
cligj==0.7.2
cloudpickle==3.1.2
colorama==0.4.6
coloredlogs==15.0.1
comm==0.2.3
condeltri==0.0.3
contextily==1.7.0
contourpy==1.3.3
coolprop==6.8.0
coverage==7.13.5
cycler==0.12.1
Cython==3.2.4
darkdetect==0.8.0
dask==2026.3.0
debugpy==1.8.20
decorator==5.2.1
defusedxml==0.7.1
dill==0.4.1
distlib==0.4.0
distro==1.9.0
docutils==0.21.2
esy-osm-pbf==0.1.1
et_xmlfile==2.0.0
executing==2.2.1
fastjsonschema==2.21.2
fastkml==1.4.0
filelock==3.25.2
flatbuffers==25.9.23
flexcache==0.3
flexparser==0.4
floris==4.3
fonttools==4.62.1
fqdn==1.5.1
frozenlist==1.8.0
fsspec==2026.2.0
future==1.0.0
geographiclib==2.1
geopandas==1.1.3
geopy==2.4.1
global-land-mask==1.0.0
greenlet==3.3.2
h11==0.16.0
h2integrate==0.7.1
h3==4.4.2
h5py==3.16.0
h5pyd==0.24.0
highspy==1.13.1
hopp==3.4.2
httpcore==1.0.9
httpx==0.28.1
humanfriendly==10.0
hybgensea==0.1.1
identify==2.6.18
idna==3.11
imagesize==2.0.0
immutabledict==4.3.1
importlib_metadata==8.7.1
importlib_resources==6.5.2
iniconfig==2.3.0
ipykernel==7.2.0
ipython==9.10.0
ipython_pygments_lexers==1.1.1
isoduration==20.11.0
isort==8.0.1
jax==0.9.1
jaxlib==0.9.1
jedi==0.19.2
jh2==5.0.10
Jinja2==3.1.6
jmespath==1.1.0
joblib==1.5.3
json5==0.13.0
jsonmerge==1.9.2
jsonpointer==3.0.0
jsonschema==4.26.0
jsonschema-specifications==2025.9.1
jupyter-book==1.0.4.post1
jupyter-cache==1.0.1
jupyter-events==0.12.0
jupyter-lsp==2.3.0
jupyter_client==8.8.0
jupyter_core==5.9.1
jupyter_server==2.17.0
jupyter_server_terminals==0.5.4
jupyterlab==4.5.6
jupyterlab_pygments==0.3.0
jupyterlab_server==2.28.0
kiwisolver==1.5.0
lark==1.3.1
latexcodec==3.0.1
lcoe==0.3.2
linkify-it-py==2.1.0
llvmlite==0.46.0
locket==1.0.0
loguru==0.7.3
lxml==6.0.2
maison==2.0.2
makefun==1.16.0
marine-carbon-management==0.1.1
markdown-it-py==3.0.0
MarkupSafe==3.0.3
marmot-agents==0.2.5
matplotlib==3.10.8
matplotlib-inline==0.2.1
mdit-py-plugins==0.5.0
mdurl==0.1.2
mercantile==1.2.1
mistune==3.2.0
ml_dtypes==0.5.4
MoorPy==1.2.1
multidict==6.7.1
multiprocess==0.70.19
multiprocessing_on_dill==3.5.0a4
myst-nb==1.4.0
myst-parser==3.0.1
narwhals==2.18.0
nbclient==0.10.4
nbconvert==7.17.0
nbformat==5.10.4
nest-asyncio==1.6.0
netCDF4==1.7.4
networkx==3.6.1
niquests==3.18.2
nlopt==2.10.0
nodeenv==1.10.0
notebook_shim==0.2.4
NREL-PySAM==7.1.0
NREL-rex==0.4.3
numba==0.64.0
numexpr==2.14.1
numpy==2.4.3
numpy-financial==1.0.0
openmdao==3.43.0
openmeteo_requests==1.7.5
openmeteo_sdk==1.25.0
openpyxl==3.1.5
opt_einsum==3.4.0
optiwindnet==0.2.0
orbit-nrel==1.2.5
ortools==9.15.6755
overrides==7.7.0
packaging @ file:///C:/miniconda3/conda-bld/packaging_1761049096285/work
pandas==2.3.3
pandocfilters==1.5.1
parso==0.8.6
partd==1.4.2
pathos==0.3.5
patsy==1.0.2
peewee==4.0.2
pillow==12.1.1
Pint==0.25.2
platformdirs==4.9.4
plotly==6.6.0
pluggy==1.6.0
pockets==0.9.1
polars==1.39.2
polars-runtime-32==1.39.2
pox==0.3.7
ppft==1.7.8
pre_commit==4.5.1
ProFAST==1.0.6
prometheus_client==0.24.1
prompt_toolkit==3.0.52
propcache==0.4.1
protobuf==6.33.5
psutil==7.2.2
pure_eval==0.2.3
pvmismatch==4.1
pyaml==26.2.1
pyarrow==23.0.1
pybtex==0.25.1
pybtex-docutils==1.0.3
PyCO2SYS==1.8.3.4
pycparser==3.0
pydantic==2.12.5
pydantic_core==2.41.5
pydata-sphinx-theme==0.16.1
pyDOE2==1.3.0
pyDOE3==1.6.2
pygeoif==1.6.0
Pygments==2.19.2
pyogrio==0.12.1
pyomo==6.10.0
pyparsing==3.3.2
pyproj==3.7.2
pyreadline3==3.5.4
pysolar==0.13
pytest==9.0.2
pytest-cov==7.0.0
python-benedict==0.35.0
python-dateutil==2.9.0.post0
python-discovery==1.1.3
python-dotenv==1.2.2
python-fsutil==0.16.0
python-json-logger==4.0.0
python-rapidjson==1.23
python-slugify==8.0.4
pytz==2026.1.post1
pywin32==311
pywinpty==3.0.3
PyYAML==6.0.3
pyyaml-include==2.2
pyzmq==27.1.0
qh3==1.6.0
rainflow==3.2.0
rasterio==1.4.4
referencing==0.37.0
requests==2.32.5
requests-cache==1.3.1
requests-unixsocket==0.4.1
retry-requests==2.0.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rfc3987-syntax==1.1.0
rich==14.3.3
rpds-py==0.30.0
ruamel.yaml==0.19.1
ruff==0.15.6
ruyaml==0.91.0
s3fs==2026.2.0
scikit-learn==1.8.0
scikit-optimize==0.10.2
scipy==1.17.1
Send2Trash==2.1.0
shapely==2.1.2
shellingham==1.5.4
simpy==4.1.1
six==1.17.0
snowballstemmer==3.0.1
sortedcontainers==2.4.0
soupsieve==2.8.3
Sphinx==7.4.7
sphinx-book-theme==1.2.0
sphinx-comments==0.0.3
sphinx-copybutton==0.5.2
sphinx-jupyterbook-latex==1.0.0
sphinx-multitoc-numbering==0.1.3
sphinx-thebe==0.3.1
sphinx-togglebutton==0.4.4
sphinx_design==0.7.0
sphinx_external_toc==1.1.0
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-bibtex==2.6.5
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-napoleon==0.7
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
SQLAlchemy==2.0.48
stack-data==0.6.3
statsmodels==0.14.6
svg.py==1.10.0
tabulate==0.10.0
terminado==0.18.1
text-unidecode==1.3
threadpoolctl==3.6.0
timezonefinder==6.5.9
tinycss2==1.4.0
toml==0.10.2
toolz==1.1.0
tornado==6.5.5
traitlets==5.14.3
turbine-models==0.2.1
typer==0.24.1
types-attrs==19.1.0
types-python-dateutil==2.9.0.20260305
types-PyYAML==6.0.12.20250915
types-typed-ast==1.5.8.7
typing-inspection==0.4.2
typing_extensions==4.15.0
tzdata==2025.3
uc-micro-py==2.0.0
uri-template==1.3.0
url-normalize==2.2.1
urllib3==2.6.3
urllib3-future==2.17.902
useful_types==0.2.1
utm==0.8.1
virtualenv==21.2.0
wassima==2.0.5
wcwidth==0.6.0
webcolors==25.10.0
webencodings==0.5.1
websocket-client==1.9.0
win32_setctime==1.2.0
windIO==2.1.1
wisdem==4.1.0
wombat==0.13.2
wrapt==2.1.2
xarray==2026.2.0
xlwings==0.33.21
xyzservices==2025.11.0
yamlfix==1.19.1
yarl==1.23.0
zipp==3.23.0

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions