Add Purchaser Load Transform
For installation, follow the published-package tutorial. For the complete modifier sequence and alternative load representations, see prepare a PCM handoff.
Use the add-purchaser-load transform to attach purchaser-load consuming technologies after parsing a base ReEDS system.
This transform adds and/or updates:
ReEDSElectrolyzerDemandcomponents and hourly profilesReEDSSteamMethaneReformingDemandcomponents and hourly profilesReEDSDataCenterDemandcomponents and hourly profiles
Why This Is A Transform
Section titled “Why This Is A Transform”Purchaser load is intentionally handled outside the parser build flow so it can be enabled only when needed.
For the ReEDS electricity-consuming technologies handled here (electrolyzer, smr for steam methane reforming and smr_ccs for steam methane reforming with CCS), this transform also avoids duplicate creation by skipping cap.csv-based component creation when the corresponding demand component already exists in the system.
Required Inputs
Section titled “Required Inputs”hour_map_myr_fpath: path tohmap_myr.csv
Optional Inputs
Section titled “Optional Inputs”hydrogen_production_capacity_fpath: path tocap.csvwith hydrogen-production capacityconsume_characteristics_fpath: path toconsume_char.csvwith electricity-consuming technology characteristicshydrogen_production_load_fpath: path toprod_load.csvwith hydrogen-production demand profileshydrogen_production_annual_load_fpath: path toprod_load_ann.csvwith annual hydrogen-production demandloadsite_op_fpath: path toloadsite_op.csvsolve_yearweather_year
Check a small data-center profile
Section titled “Check a small data-center profile”Continue from the fixture tutorial in the same Python session. This three-hour
synthetic example creates a separate data-center component in region p1.
It demonstrates the input contract and is not a complete annual demand case.
For hydrogen-production inputs, use the configuration reference and PCM handoff
schemas above.
>>> from pathlib import Path>>> from tempfile import TemporaryDirectory>>> import polars as pl>>> from numpy.testing import assert_allclose>>> from r2x_reeds import ReEDSDataCenterDemand>>> from r2x_reeds.sysmod.purchaser_load import PurchaserLoadConfig, add_purchaser_load>>> with TemporaryDirectory() as folder:... policy = Path(folder)... pl.DataFrame({"yearhour": [1, 2, 3], "h": ["h1", "h2", "h3"]}).write_csv(policy / "hours.csv")... pl.DataFrame({"r": ["p1", "p1", "p1"], "allh": ["h1", "h2", "h3"], "t": [2032, 2032, 2032], "Value": [5.0, 6.0, 7.0]}).write_csv(policy / "sites.csv")... purchaser_cfg = PurchaserLoadConfig(solve_year=2032, weather_year=2012, hour_map_myr_fpath=policy / "hours.csv", loadsite_op_fpath=policy / "sites.csv")... result = add_purchaser_load(system, purchaser_cfg)... assert result.is_ok(), result.unwrap_err()... demand = system.get_component(ReEDSDataCenterDemand, "p1_data_center_demand")... assert demand.capacity == 7.0... series = system.get_time_series(demand, name="max_active_power")... assert_allclose(series.data, [5.0, 6.0, 7.0])...The assertions check both component capacity and actual profile values. The
original electric-demand component remains separate. For a production run,
reconcile its complete year with the selected weather calendar and avoid adding
the same site increments through add-optimal-siting.