Release Notes#
bonsai-api#
Version 0.1.3 (upcoming)#
Version 0.1.2#
Changed
Refresh the package release from
main; the API implementation is unchanged since 0.1.1.
Version 0.1.1#
Enhancements
Add opt-in, execution-scoped in-memory caching for complete JSON classification and correspondence queries, shared across connectors with query/authentication isolation, independent returned data, default/refresh modes and invalidation before writes. Standalone reads outside a scope and other endpoints remain uncached.
Version 0.1.0#
Enhancements
Added the initial standalone BONSAI hosted API client package, exposing connectors and hosted API endpoint definitions under
bonsai.api.Retry interrupted GET downloads per page with bounded backoff and connection/read timeouts.
bonsai-io#
Version 0.38.0#
Added
Compare national employment and hours worked with Eurostat national accounts and export country diagnostics and charts.
Estimate payroll weights from employee hours in the labour workflow. Pin the Eurostat LFS inputs and keep the existing D1 totals.
Compare employee-hour fraction estimates, common-fraction payroll weights and the Eurostat employee-count proxy in a separate labour pilot.
Prepare both release ZIPs from the same native b2 files with
prepare_release. Save the approved ZIPs and manifest under_bonsai/release/<version>.Compare balanced regional value added on a GDP basis against UN national accounts and export a CSV and chart.
Validate total compensation of employees (D1) before monetary value-added export. Set residuals within 0.001 euros of zero to zero and reject larger negative values.
Pool direct production fuel inputs in activity-specific fuel markets before balancing.
Changed
Remove direct payroll allocation from SES employee counts. Retain the SES equal-paid-hours profiles in hierarchical payroll-share training.
Rename the labour tasks
clean_labour_datatoclean_ilostat_labour_dataandclean_labour_sourcestoharmonise_labour_sources.Resolve labour’s ISIC Rev. 4 correspondence targets against BONSAI Activities regardless of the correspondence’s base-class label.
Collect Rest-of-World labour membership from BONSAI location parents when pinning a new labour snapshot.
Package the hybrid input-output table, final demand, direct elementary flows, and classifications in
pandas.zip.Replace the standalone Brightway workflow export and its
tidy_<version>directory withbrightway.zipin the dataset release.Remove
bonsai.io.export_tasks. The SimaPro task lives inbonsai.io.release.export_tasks.Merge supply-derived and exogenous-coefficient emissions from the configured run and reject duplicate principal-product mappings when assembling the hybrid SUT.
Read textile supply from its dated producer account and load the monetary product correspondence with its saved index.
Export cross-border waste treatment services from physical shipments and combine waste fractions by treatment before calculating market shares.
Exclude national mixes from the EDGAR F-gas allocation to all production activities and correct the fossil fuel and wood extraction report name.
Extend the standalone balanced SUT aggregation script with supply, use and extension aggregation and an EU28 steel recycling scenario.
Read OECD cleaning inputs by their producer-defined filenames so legacy exports cannot enter the current accounts.
Build and clean OECD national monetary SUTs for the integrated OECD, FIGARO and UN accounts. Retire standalone Eurostat national SUT outputs from the workflow.
Derive gross value-added coefficients from the pre-balance exchanges. The technical constraint CSV stores the reviewed bounds.
Map OECD by-products using monetary product codes derived from principal outputs. Reuse an agreed mapping across OECD countries and warn when omitting unresolved co-products.
Publish OECD monetary supply on a principal-only basis. Move co-product output to the local principal industry and transfer intermediate inputs and value added by output share. Record omissions and their associated costs in separate audit accounts.
Create local OECD principal industries for co-products when the same product has an agreed principal industry abroad. Transfer inputs and value added by output share and retain the omission audit for products without a usable assignment.
Scale Rest-of-World gross surplus and other net production taxes to UN gross value added. Warn when reported components do not reconcile.
Read fugitive fuel use and extension inputs from the configured Balanced account without updating account registries.
Subtract the fossil CO2 from recovered steel by-product gases at the producer so combustion emissions are counted once.
Require allocated EDGAR F-gas estimates in the country benchmark. Add their AR5 GWP100 CO2 equivalents to the BONSAI totals and report their contribution separately.
Allocate EDGAR gaseous/liquid-fuel fugitive CO2 to M_ activities using exact C_ fuel inputs from balanced use, normalized by consuming country and mapped category. Convert Gg to tonnes and retain source-level coverage, incompatible-unit and conservation diagnostics.
Gap-fill remaining EDGAR oil/gas allocation gaps from final consumption in TJ after flaring/production allocation, preserve previously allocated shares, and carry recovered rows into the final activity account.
Convert UN final energy consumption of
C_COIL,C_GASEandC_GASLto TJ using source conversion factors first and product/country heat values as a tonnes-only fallback; preserve existing TJ values and reject unresolved conversions.Include the allocated product code (
C_COIL,C_GASEorC_GASL) in the joined EDGAR/flaring table, derived from its field type.Convert UN crude-oil and natural-gas-liquid production (
C_COIL,C_GASL) from tonnes to TJ using country-specific product heat values in the CH4 missing-weight preparation, retaining other units/products and rejecting missing or invalid heat values.Allocate EDGAR oil-and-gas methane by country-specific flaring-volume shares across field types; gap-fill missing/zero shares from UN production in TJ returned by
create_weight_for_missing_values, using crude oil, natural gas and natural gas liquids (the user-selected LNG proxy). Retainweight_flaring,weight_production, allocation provenance and year values; renormalize each fossil/biogenic observation independently and leave unsupported allocations unknown. The fallback no longer reads balanced monetary supply.Add 11 EDGAR-to-World-Bank country-name aliases for joining methane and flare-volume source tables.
Store EDGAR F-gas activity/use allocation rules and food-name inclusion/exclusion lists in
paths.correspondence / "exio4_other" / "edgar_f_gas_allocation.json", load them for each allocation run, and build matching patterns locally. Reject duplicate JSON keys, invalid relations and invalid lists.Allocate EDGAR sector/gas observations using same-country balanced monetary product output, then allocate pending use-based relations using selected-product consumption by destination country, including final consumers and excluding market mixes. Preserve repeated mappings, source-level conservation, units and explicit missing/unallocated diagnostics.
Load the IPCC 2006 sector sheet for
Config.yearfrom the pinned EDGAR AR5 F-gas ZIP. Require the sector labels and balanced export metadata used in allocation, and keep missing observations and source provenance.Calibrate China’s 2016 employment to ILOEST headcounts by sex and report estimated paid employees.
Carry Rest-of-World employee compensation into the labour accounts using the existing UN gross value-added scaling.
Omit the seed date from GVA constraints.
Allocate value added once per source industry when OECD supply contains multiple products, and write the value-added report in a fresh run directory.
Keep OECD secondary output, intermediate use and employee compensation with their original producing industries in the monetary SUT build.
Read dated inputs in graph construction and b2 HIOT assembly with
paths.compose(..., read_only=True), without creating directories or updating version registries.Use the configured run date for graph construction inputs and outputs so balancing reads the graph from the same run.
Run the PPF replacement selector after the supply importer, and run SimaPro and Brightway exports after their b2 elementary-flow inputs are built.
Document and verify the China 2016 natural-gas methanol pilot using the existing simple PPF builder and the shared input manifest.
Fix the steel PPF replacement selector to read the imported supply product code and follow the selected routes’ activity parents while retaining the national steel mix.
Select simple PPF coefficients by exact country and year when a table has multiple scopes. The prepared 2016 coke inputs preserve the archived recovery and non-recovery routes.
Store the shared simple PPF input manifest, source tables and prepared builder inputs under
collect/ppf_simple.Add a simple PPF cement production pilot for Afghanistan in 2016, covering cement, concrete, and mortar. Keep carbonation outside the annual production account. Accept empty property tables for unbalanced PPFs and read simple PPF emissions by their substance and compartment.
Match simple PPF recipes to production by activity and reference product so every route in a country and year uses its own volume. Reject ambiguous production rows and routes with no recipe.
Store recovered waste-biogas nutrient by-products in the dated Supply account; migrate all readers and link fertiliser assembly to its producer.
Store execution logs under
BONSAI_HOME/_bonsai/loggingrather than the EXIOBASE account directory, without an account-version lookup. Keep scientific diagnostics at their existing artifact paths.Write one UTF-8 log per workflow execution instead of appending task reports to a daily file. Share a timestamp/UUID execution ID across tasks in
execute,run_tasksandrun_task; directTask.runcalls create their own execution. Retain task reports and capture logger messages and failure tracebacks in the execution log.Export only thermal-power water withdrawal and release as elementary-flow coefficients. Keep consumptive water use as an intermediate quantity for calculating release.
Remove obsolete marginal-electricity generation and insertion tasks, their workflow imports, artifact readers and path.
Replace country-converter in the thermal-power water reader with maintained backend location correspondences. Preserve national capacity-factor joins, resolve child locations, reject unmapped countries, and remove the dependency. Correspondence records are maintained directly in the backend.
Preserve year-specific mass conversions by joining country/product factors on period when available; retain timeless conversions when the period column is empty. Restore the compiled property-matrix object/origin schema, indexed vehicle identities and intrinsic-property scope for downstream readers. Refresh corrected fertiliser supply, the biogas supply intermediate and human-consumption coefficients through their actual workflow dependencies. Retain default Food waste routing where no explicit product/activity human-consumption mapping exists.
Resolve packaging labels through API product names/descriptions and the 15 maintained
BONSAI_PACKAGINGproduct correspondences. Switch the LCI, packaging-use and production/trade readers away from the local1-to-1pickle, retaining source labels for numeric routing and rejecting missing or ambiguous targets. Keep residual and replacement mappings unchanged.Read packaging root-to-leaf groups from API product UUID parent links in use/supply, emissions, technical-coefficient and waste-fraction tasks. Keep the same configured five-root scope and terminal descendants, reject broken groups, and reuse already loaded product metadata. Preserve local packaging labels, old-to-new replacements and classification-generation outputs for their remaining readers.
Generate simple-PPF central quantities directly from production volumes and LCI coefficients with unit conversion. Propagate supplied absolute standard deviations analytically under an independent-input moment assumption for shared-solver balance weights; retain unknown uncertainty and fixed property contents. Confidence-interval conversion uses the existing normal approximation. These weights are not uncertainty estimates for the final balanced system.
Prune redundant import, constructor, schema-guard and wrapper-only tests while retaining numerical, conservation, serialization and workflow-failure regressions. Check generated Airflow tasks, groups and dependencies instead of an exact formatting snapshot.
Pin NumPy to 2.1.3 and raise the package’s declared Python minimum to 3.10 to match NumPy 2.1 support. Keep pandas and the solver stack unchanged.
Route optional simple-PPF property balancing through the shared native sparse/Gurobi solver. Keep property contents fixed, reconcile only flow quantities with uncertainty weights and supplied bounds, convert conservation equations to compatible units, and reject missing contents. Remove the separate SLSQP optimizer and invented property defaults; preserve property tables and export solver diagnostics using the existing Config balance settings.
Restore execution-date suffixes (
YYYYMMDD) on both EDGAR production-comparison CSV and PNG reports; retain inventory year and GWP100 labels inside the reports.Restrict total_elementary_flow.b2 CSV/pickle exports to core account columns, retaining time and substance_name. Leave source metadata in upstream artifacts and omit the CSV index.
Read GVA technical coefficients and bounds from the persistent LCI technical-constraint dataset instead of generating and overriding them during graph construction. Add an explicit, append-only seed script with initial GVA/reference-output evidence, signed legacy bounds, previews and backups; preserve reviewed edits and fail on missing GVA recipes.
Removed
Remove the dedicated
test_dataio_removal.pyandtest_land_occupation_units.pytest files.Remove toy car/truck classification data and its import-time example calculation from
classification/util_classification.py; retain the packaging classification function unchanged.Remove simple-PPF Monte Carlo sampling, distribution fitting, the
n_samplesargument and fitted distribution labels from generated flow tables. Input distribution names and sampling limits no longer alter central quantities.Remove the remaining runtime dependency on
bonsai-dataio. Own monetary-SUT column contracts locally and use project Config plus local CSV/resource-manifest handling for simple PPF tasks. Omit unused uncertainty columns from monetary-SUT exports; retain PPF uncertainty inputs, OECD classifications and PPF artifact names. RetainDATAIO_ROOTfor external source files and allow an explicitppf_data_root.Remove the obsolete inverse-based
calculate_emissionshelper, unused Matrix normalization/circular-dependency methods, and unreferenced legacy land-footprint modules. Remove the old outlier-analysis preparation and dependent helpers that required the already removed inverse builder. Keep the direct-solve footprint workflow unchanged.
Fixed
Remove dedicated fuel markets along with already excluded transformation activities during hybrid SUT assembly, preventing orphan unclassified fuel supply from breaking price gap filling. Warn with the product and activity codes present before excluding them. Include missing product codes in the price-classification error.
Version 0.37.0#
Changed
Pin the companion API and exporter dependencies to their package-specific
bonsai-api-v0.1.2andbonsai-export-v0.4.2release tags.Consolidate duplicated post-balance analysis methods and raw/initial account initialization. Preserve public analyzer classes, stage-specific file loaders, country filters and numerical checks.
Allow CSV technical recipes to bind a unique local product input as denominator when the named output is absent, supporting waste-treatment demand tied to material input. Retain output precedence and reject ambiguous bindings.
Document local mixed-fuel/output recipe bounds for the revised fuel-market routing, including auxiliary-fuel exclusions and the conditional CHP output-split assumption. Keep the graph constraint representation and direct footprint solver unchanged.
Keep raw products entering their mapped market directly, avoiding self-use when recovered nutrients are routed to shared markets. Prefer the dedicated nutrient-content supply account over generic market supply when assembling overlapping fertilizer markets.
Recalculate output-dependent PPF emissions after balancing so footprint rebuilds use the new balanced quantities.
Fetch elementary-flow density metadata only when a dimensional conversion needs it, and select the requested property types explicitly when the API does not filter them.
Translate API role tags to
ActivityNode.properties["activity_type"]instead of storing a separate tags field. Stone reads that scalar role; preserve final-demand classification and reject ambiguous joined roles.Carry API activity roles into SUTGraph, rename node metadata to
properties, and require rebuilding older graph pickles. MakeStoneModel(graph)return a transformed characteristic-exchange graph view, with no separate market argument, post-balance routing correspondence or credit matrix. Compile b1 directly from that graph and retain the existing direct footprint solver. Preserve unknown-tag branches under cut-off.Extract IO-free
StoneModelfrom the Stone workflow. Carry exclusive by-product origin through recovery conversions and exclusive markets, returning the receiving principal-market substitution credit and recovery burdens to the originating activity. Keep existing nodes, direct footprint solving and unresolved-branch cut-off; no product-specific recovery routes or additional diagnostic exports.Screen disaggregated employee compensation per hour before labour exports, with configurable provisional EUR/hour warning limits and cell/activity CSV diagnostics. Use same-year cleaned ILO employee-hour proxies; leave unsupported denominators unassessed and preserve all allocations.
Tighten the general mass-product implied-price upper bound from 100 to 50 times its initial value. Retain the 0.01 lower multiplier and existing product-specific, energy, item-count and waste-service ranges. Rerun balance to apply the new ceiling to results.
Removed
Remove the unimported
waste.waste_supply_and_use_calculationmodule and the three unused waste-use variants inwaste_supply_and_use_accounts. Remove uncalled legacy packaging, emission-coefficient, biogas-mix and waste-aggregation helpers, along with their disabled task references. Preserve registered waste tasks and producers of artifacts still read by market calculations.Remove the unused
add_special_market_to_use_tablefunction and its commented invocation. Its intermediate exports have no active consumers.Remove the unused
hiot.map_by_prod_to_marketscombustion-utilisation pipeline, the unusedhiot.util_hiot.export_to_pklwrapper and its unused imports. Retain the standalone EXIOBASE conversion module.Remove the unused
hiot.generate_value_addedmodule, its exclusivePathBuilder.value_addedaccessor and EXIOBASE product-to-activity workbook registry entry. Keep active value-added preparation/reporting inpartial_SUTs.value_added.Consolidate duplicate FAOSTAT country mapping, UN mass conversion and FIGARO country-merge helpers while preserving existing import names. Simplify analysis filters, remove repeated waste checks/exports and unreachable SUT filtering, and drop tests of standard dataclass machinery.
Remove repeated coefficient-resolution passes from balance compilation and RDF export by sharing the graph’s validated traversal. Remove obsolete solver-keyword rejection tests already covered by public-signature checks.
Remove the hard-coded Stone by-product-market exclusion list and positional square-matrix/zero-diagonal pruning from full HIOT assembly.
Remove the previous complete-profile employment-share fitting route and its configuration switch. Always fit observed-subset log contrasts using eligible complete and partial native evidence; retain the shared Gaussian regressions for employment totals, hours and payroll, and historical validation results.
Remove vulnerable-hours calculations and fields from processed labour profiles, accounts, coverage and footprint outputs. Retain 18 sex/skill indicators for total employment, total hours and employee compensation; employee-hours remain internal to D1 allocation. Rebuild labour profiles and downstream artifacts to refresh saved schemas.
Remove the
value_added_allocation_excluded.csvexport; report unmapped source components through warnings.Remove raw Eurostat wage mixing from
calculate_labour_profilesand itseurostatargument; construct ILO-only native profiles and merge providers only after BONSAI activity harmonisation.Remove
_legacy_reference, its RDF/diagnostic metadata and all coefficient-specific country, characteristic-layer, near-zero, bidirectional-substitution and seed-floor exceptions. Removecalibrate(min_positive=...); every coefficient uses the same declared-flow validation, calibration and compilation rules, including strict central-estimate bounds and distinct-layer checks.Remove automatic migration of flow-owned technical coefficients and the custom
BoundedValueunpickler. Read current graph layouts directly; reject obsolete coefficient fields with an instruction to rebuild throughconvert_sut_to_graph.Remove the Pyomo balance route,
BalanceModel, its constraint/objective modules and the Pyomo dependency. Remove backend/solver selection and legacy executable/log-path arguments from balancing entry points; native Gurobi is the only implementation. Preserve verified equation and optimum fixtures for regression checks without Pyomo.Remove dedicated transfer-coefficient constraints from balancing, their flow field and skip diagnostics. Transfer relationships belong in general activity-owned technical coefficients; saved graphs containing obsolete coefficient fields must be rebuilt.
Remove
BoundedValueand flow-owned technical-coefficient storage and setters; use activity-ownedTechnicalCoefficientrecords.Remove
Property.warm_start, solver export of cached adjustment factors and inactive warm-start reuse code; retain balanced quantities on graph properties and factors on native solve results.Remove the unused
PathBuilder.iLUC_rawproperty.Remove the standalone
check_ghg_of_countriesanalysis task;merge_extensionsnow callsutil.validate.validate_ghg_of_countries, which owns benchmark reads, country resolution and CSV/chart exports around a separate comparison calculation.
Deprecated
Deprecate graph-domain imports from
util.graph,util.technical_coefficient,util.location,util.periodand theutil.schema_enumsproperty exports. Retain aliases to the canonical graph classes for older callers and trusted pickle loading.
Fixes
Align FAOSTAT cleaning tests with provider-scoped correspondences and labour footprint fixtures with NumPy reference-row metadata. Install the local exporter explicitly in tox to avoid testing an older installed converter.
Preserve linked by-product market reference nodes and downstream uses during Stone classification preparation. Avoid artificial tiny product rows from repeated subtraction of direct routing allocations.
Temporarily exclude the M_OGPL market and its uses from Stone processing to avoid the known fuel-market feedback defects. Keep M_MBIO and other exclusive by-product chains included; the upstream market-data issue remains unresolved.
Write NumPy boolean reference-row flags for EXIOBASE footprint matrices. Reject obsolete serialized reference metadata with an actionable HIOT rebuild error instead of failing on string array operations.
Keep tier-one technology normalization, diagonal extraction and recipe extraction sparse, avoiding full dense technology arrays and dense diagonal matrices.
Avoid pandas copying the full activity/reference mapping to every column during sparse HIOT assembly.
Store one full HIOT matrix under
extended_size_hiot.b1/b2.pkl, with reference rows first and explicitis_referencerow metadata. The direct solver selects the reference block internally and restores zero-burden outputs; remove separate prepared artifacts and repeated preparation helpers.Preserve exclusive by-product chains and country/unit-specific unrouted fractions. Assemble full rectangular supply-use technology with explicit reference links; apply producer-gate cut-off only when preparing the existing direct footprint solve. Retain downstream burdens and report physical residuals separately from reference-demand feasibility in the existing imbalance output. Update contributions, calculable exports and current analysis readers; rebuild Stone/HIOT artifacts to adopt the new layout.
Read the prepared
trade_of_waste_treat_services.pklaccount in general bilateral trade for the configured run date. Preserve its service-provider direction and quantities instead of relabelling physical waste exports as treatment-service exports; fail if the prepared account is missing.Merge Stefano’s latest pre-balance updates: include recovered materials and energy/nutrient by-products in monetary allocation weights, read physical waste trade from the waste-supply account, and add a balanced-SUT EU28/extra-EU aggregation script. Preserve unmatched root/leaf codes and keep activity replacements in the activity column.
Add a hierarchical employment-share model that learns only observed log contrasts from incomplete native sex/skill profiles, preserving existing cells and fixed D1. Audit added evidence, include it in model hashes, and compare against complete-profile training on identical blocked holdouts. Always use broader native evidence following the user’s 2026-11-12 preference; retain the higher complete-profile holdout errors in reporting.
Fit total employment independently of six-cell sex/skill completeness when coherent published ILO totals have explicit armed/unclassified counts removed. Preserve existing complete-profile totals and subgroup training, and export candidate eligibility audits for the added evidence.
Temporarily allow only
U_wFoodactivities to have no incoming exchanges so unregistered food-waste service survives graph pruning. Preserve identity, outgoing-flow and graph reference-output validation; track the modelling exception with a dated FIXME assigned to Fan.Allow post-balance value-added reporting when source components are unavailable. Retain every gross-GVA row in reconciliation, warn about missing/partial breakdowns, and distinguish observed partial sums from complete component totals without inventing zero accounts.
Restore pre-balance value-added component proportions using the original source and allocation schemas, retaining the proportions for post-balance reporting.
Merge Stefano’s pre-balance updates: use the FIGARO/UN/OECD value-added source, retain its producer tasks in the dedicated value-added module, filter FAOSTAT country correspondences by provider, and preserve the current graph and
food_n_agripackage layout.Integrate positive unregistered-waste accounting, food/metabolism coverage and global-market corrections; retain explicit validation of downstream quantities and footprints.
Allow complete Eurostat SES compensation profiles without an ILO dataset-A employment profile. Preserve D1 totals and report the approved employee-count/hourly-earnings proxy independently from employment and hours coverage.
Add 239 reviewed direct ISIC Rev.4 links for detailed balanced-SUT activity codes, including food, livestock, electricity, residual manufacturing, waste sorting and services. Provide a maintenance command that preserves existing backend correspondences and verifies the complete resulting mapping; runtime labour allocation continues to use the refreshed backend snapshot.
Relax the GVA technical-coefficient lower multiplier from
0.01xto0.001x, retaining the capped initial coefficient,10xupper multiplier and signed-bound ordering. Rebuild saved graphs to apply the new bounds.Identify activity, location, product, layer, units and bounds when a technical recipe binds the same flow layer on both sides; retain strict rejection instead of silently discarding invalid source recipes.
Write fertiliser market-use CSV, pickle and content report to the dated
Useaccount; update partial-use assembly and iLUC readers to consume that account.Enforce production-activity ownership in
TechnicalCoefficient.resolvefor every coefficient, including legacy records. Reject market, national-mix, final-demand and non-activity owners; remove redundant owner skips from calibration and balance selection instead of silently ignoring invalid coefficients.Honor
Exio ref. prod codeandunit_reffromtechnical_constraints.csvwhen constructing explicit activity-ownedTechnicalCoefficientrecords. Preserve distinct denominator products/layers during deduplication, give generated GVA recipes explicit denominators, and validate missing bindings without substituting the activity’s default reference. Graph construction no longer callsadd_reference_technical_coefficient.Relax the GVA technical-coefficient upper multiplier from
2xto10x, retaining the capped initial coefficient, lower multiplier and signed-bound ordering. Rebuild saved graphs to apply the new bounds.Avoid duplicate technical-coefficient warnings for flows already removed and reported by graph pruning.
Preserve signed GVA and other signed exchanges during technical-coefficient calibration: retain negative ratio bounds and avoid applying the positive seed floor to negative inflows. Report activity, exchange and bounds for genuine sign conflicts.
Keep transfer-coefficient reads, formatting and merging in
convert_sut_to_graphtemporarily commented out while that assembly path is inactive.Allow 600 seconds per native failure-diagnostic stage (feasibility-only LP and IIS), preserving configurable overrides and the primary balance solver’s work limit.
Rename the internal
bonsai.io.faostatpackage tobonsai.io.food_n_agriand update imports, preventing it from shadowing the installed FAOSTAT client during direct-script startup.FAOSTAT collectors authenticate before their first request: FAOSTAT now answers anonymous calls with
401 Unauthorized. SetFAOSTAT_TOKEN, orFAOSTAT_USERNAMEandFAOSTAT_PASSWORD, in the environment or the.envfile; requiresfaostat>=2.0.1.FAOSTAT production and land-use cleaning drops aggregate areas (area codes from 5000: World, continents, regions and groupings such as the EU). They restate their member countries, so every sum counted them twice; the continents alone carried 41% of 2016 harvested area.
Clarify CC BY 4.0 for published BONSAI data separately from MIT software and upstream source licenses (documentation#141).
Write generated intensification coefficients and national fertiliser volatilisation fractions, including their provenance reports, to
iLUC_intermalongside other iLUC intermediate artifacts.Balance national mixing activities (
A_Nat_) as markets on characteristic and monetary layers in native balancing, excluding them from ordinary production multipliers.Validate production country GWP100 from the configured run’s in-memory environmental extensions, excluding labour; retain missing country coverage, signed values, mass-unit conversion and maintained EDGAR mappings in year/metric-labelled reports. Declare Matplotlib for headless chart export.
Tighten calibrated supply-layer bounds using declared technical ratios and denominator-output bounds, preserving tighter source limits and reporting conflicts instead of retaining redundant extreme adjustment ranges.
Restore national electricity-mix and other co-product supply rows when removing tiny outputs; distinguish producers sharing a product.
Route national steel output to its steel market and correct steel-process gas handling.
Provisionally relax the default independent balance residual acceptance to
1e-3across native balance entry points; retain stricter overrides, original-unit diagnostics and Gurobi’sFeasibilityTol=1e-6.Match elementary-flow correspondence labels case-insensitively, rejecting conflicting case variants and quoting unresolved labels in warnings.
Export annual crop and pasture occupation in square meter-years; normalize legacy area-only occupation rows during extension merging without altering transformation units or applying density factors.
Enhancements
Add empirical-Bayes hierarchical gap filling with country/industry partial pooling, joint sex/skill compositions, annual working-hour rates and payroll-share prediction. Train at native source resolution, validate by hiding country/sector blocks and entire countries, and compare with pooled donor estimates. Pin national ILO employment separately, retain incomplete margins as bounds, and reconcile overlapping classified employment benchmarks while preserving observations and fixed D1. Export training, holdout errors, conditional prediction ranges, model fingerprints and benchmark diagnostics; distinguish proxy-reference accuracy from independently measured payroll accuracy.
Add a shared observation/scope/target model and constrained estimation core with exact identities, uncertain evidence, identification ranges, original-unit residuals and holdout scoring. Reuse graph quantities, locations and periods without generated context IDs. Labour now retains native observations and partial estimates, can reconstruct a missing skill from compatible published margins, and combines individually usable employment/hour cells when no complete source exists. Preserve fixed D1 and existing complete-source priority; export per-cell provenance and selected-source conservation audits. Ratios retain separate quantity units; no population or uncertainty assumptions are inferred by the generic core.
Add separately pinned Eurostat LFS joint employment collection, provider-to-BONSAI cleaning and coherent six-cell metric source selection. Retain source population, broad activity scope, year, suppression and conservation audits; expose
labour_allow_ses_hourly_proxyfor the explicitly labelled equal-paid-hours proxy.Build exchanges and technical coefficients in separate passes in
convert_sut_to_graph, without merging ratio limits into flow records or collecting pending coefficients during exchange creation. Attach recipes after all exchanges exist, then let pruning remove invalid nodes and dependent coefficients before calibration; retain input, by-product and signed GVA policies.Own graph definitions in
bonsai.io.graph, separating nodes, flows, properties, enums, technical coefficients, locations, periods and the SUT graph. Update repository imports and preserve existing graph pickle identities and numerical behavior.Add immutable
graph.location.Locationandgraph.period.Periodvalue objects for future graph and observation dimensions. Reuse existing location classification UUIDs and parent references; identify date periods by inclusive-start/exclusive-end boundaries without generated IDs. Nodes retain their existing location/time fields in this first step.Represent technical coefficients as activity-owned relationships between two flow quantities, with separate units and optional characteristic-unit denominator defaults. Support non-reference exchanges in native balancing, calibration and review selection; apply uniform ratio rules without migrating obsolete graph layouts.
Add
scripts/compare_value_added.pyto compare total balanced gross value added against named EXIOBASE satellite accounts, with country differences, overall totals and country-coverage diagnostics.Integrate steel PPF production and recipes with national production mixes and energy/emissions processing.
Extend nuclear-fuel trade rescaling and bituminous-coal disaggregation, enforcing positive national export/import margins and retaining rejected-route diagnostics.
Add initial UN household food-waste benchmarking support; this does not establish corrected waste allocation.
Collect and clean FAOSTAT crop and livestock production (
QCL) and land use (RL) for every year ofyear - periods .. yearinstead of only the two endpoints. Years that were never collected are skipped with a warning.Cleaned FAOSTAT tables keep FAOSTAT’s
Area Code; production and land use also get the UNM49 Codeand FAOSTAT’s canonical area name from the newfao-m49correspondence (corrspondence/fao/FAOSTAT_country_vs_ISO_20240130.csv). Rows of dissolved reporters (Belgium-Luxembourg, Netherlands Antilles, Serbia and Montenegro, former Sudan) are kept with a blank country code, and area names that the location correspondence maps to the undefinedTaiwan, Province of Chinafall back toRoW Asia and Pacificinstead of being dropped.
Version 0.36.0#
Removed
Remove the obsolete
decompose_land_use_for_given_activitieshelper and its analysis-script call, which used legacy inverse and land-footprint artifacts.Remove
create_country_correspondence_edgarand its France/Italy overrides; country GHG checks use the maintained EDGAR 2024 location-correspondence API.Remove
scale_rowsfrom the native compiler and balance entry points, and removeConfig.balance_scale_rows; native compilation always normalises each row and its bounds by the largest absolute coefficient, retaining original scales for diagnostics.Remove
bonsai.io.balance.technical_constraints; candidate-generation helpers now live inbonsai.io.agent.candidates.Remove the former
bonsai.io.balance.agentsimport path and agent-review entry point frombalance.run; usebonsai.io.agent.reviewandbonsai.io.agent.runrespectively.Remove the
Config.resource_repositoryalias; useConfig.resource_repositoryin workflow code, scripts and test fixtures.Remove
clean_stock_animaland its workflow registration. Both livestock-water readers now identify animals from QCLStocksrows infao_crop_anim_prod.csv; declare the QCL cleaning task upstream of the AQUASTAT calculation.Remove the labour collection task’s
refresh_activity_correspondenceargument and correspondence snapshot backup/cache controls; preserve raw provider snapshot checksums and reuse.Replace the b2 artifact basename
total_elementary_flow_w_iLUCwithtotal_elementary_flow.b2for CSV and pickle exports; update footprint, contribution, exporter, and analysis readers without changing the data.Replace the
add_iLUC_emission_to_elementary_flowsfunction and workflow task withadd_iluc_emissions_to_extensions; preserve calculations and artifact filenames.Replace the post-balance
merge_recalculated_elementary_flowsfunction/task name withmerge_extensions; update dependencies, the skip list, and workflow checks. Existing artifact filenames are unchanged.Replace the old
bonsai.io.elementary_flowsPython import namespace withbonsai.io.extensions; update callers without renaming existing data artifacts.Remove the obsolete fertiliser-market wrapper and its task registration; retain the individually registered fertiliser tasks.
Remove unused
prepare_partial_use_tableandinsert_unit_productutilities and unused reads and commented calculations from legacy technical-coefficient bound generation.Remove the unused duplicate
reformat_output_land_transffromiluc.land_use_calculations; retain the formatter used by the model iniluc.land_use_utils.Stop registering the unused legacy internal-use coefficient-cap and coefficient-bound tasks; retain their functions and the active consolidated technical-constraint path.
Remove
Matrix.inverse()andinverse_streaming(), their temporary-file assembly and CuPy inverse backend.Remove the b2 inverse-export task; b2 footprints now use direct solves.
Remove the legacy partitioned-inverse notebook and obsolete imports and commented inverse calculations.
Remove the unused forestry-price helpers
aver_world_price,insert_prices_to_subcategories, andinsert_prices_to_subcategories_foresfromutil_others; their forestry callers were already commented out.
Fixes
Restore direct backend labour correspondences and explicit joined-activity mappings; refresh backend tables on collection while keeping only provider snapshots pinned by the manifest.
Read the shared terminated elementary-flow pickle in the SimaPro task, retaining the current artifact name and labelled axes when integrating the exporter update.
Tighten the graph flow upper-bound expansion from
1e5to1e4, retaining the existing lower-bound expansion.Fix country GHG checks referencing an undefined global config. Join EDGAR country codes to validated API location mappings, reject missing or ambiguous records and exclude explicitly unmapped international/aggregate totals.
Retain Meuro-valued and explicitly joined activity outputs in capital allocation, match physical prices by unit, and recover CFC priors directly from source ratios instead of zeroing them when current output is absent. Repair the CFC refresh helper and preserve accumulated observations during preview and refresh.
Rebuild the assembled SUT, graph, balance, capital accounts, extensions and physical/monetary footprints from updated upstream tables in the main launcher; refresh the separate iLUC branch and remove stale skips of required footprint tasks.
Use the shared sparse direct solver for world-demand product-imbalance validation instead of restarted GMRES; retain backward-error and diagonal-scaled residual checks and preserve signed activity scales.
Resolve Stone-market and national-mix output products from backend activity reference flows, including joined classifications, instead of hard-coded activity names. Use the same mapping for by-product replacement joins to avoid spurious extra reference outputs such as national BOF steel.
Allow empty, zero and signed environmental rows in climate contribution preparation; filter by climate factors before filling environmental gaps, excluding uncharacterized labour rows.
Restore labour rows in the shared post-balance extension artifact consumed by the iLUC and footprint tasks, and select the configured Balanced run date explicitly in the iLUC merge.
Bug fixes
convert_bonsai_to_simaproreads terminated-activity emissions from theterminated_act_emissions.b2.csv.pklpickle; the CSV was read with two index columns although it has one, which dropped the first terminated activity (AU;C_ACCOM).convert_bonsai_to_simapropasses prices keyed by(country, product code), matching the exporter’s metadata lookup.
Enhancements
Raise the native independent residual acceptance default to
2e-5, retaining configurable stricter checks and Gurobi’s1e-6feasibility tolerance; record the acceptance threshold in diagnostics.Move technical-constraint review candidate generation into
bonsai.io.agent.candidates, preserving the post-balance candidate export and its schema.Move local LLM evaluators, technical-constraint review policy and review orchestration from
balanceintobonsai.io.agent.reviewandbonsai.io.agent.run, preserving review behaviour and artifact paths. Update callers to the new module paths.Make native Gurobi the default balance backend and retain Pyomo as an explicit reference alternative. Compile labelled CSR equations with canonical ordering and normalised constraint rows, use deterministic barrier/thread/seed/work-limit defaults, and record model/solution fingerprints, solver version, numerical checks and timings. Include
gurobipyin core dependencies; retain the existinggurobiextra for compatibility.Accept native
SUBOPTIMALcandidates when a solution exists, independent feasibility checks pass and deterministic solver settings are used. Record that optimality is unproven and warn on acceptance; retain rejection of other termination states, missing candidates and failed feasibility checks.Complete the isolated full-production backend comparison, including every intended equation, bounds, objective, candidate residuals, quantity differences, timings and memory. Native uses less memory and builds faster, but all benchmark runs terminate suboptimally and neither audited candidate passes every recorded residual check. Keep those historical results distinct from the subsequent default and acceptance-policy change.
Rename resource-repository
get_dataframe_for_tasktoget_dfandadd_from_dataframetowrite_df; update callers, legacy writer references and automatic caller-name detection.Move post-balance crop and wood CO2 uptake recalculation into
extensions.environmental.recalc_environment_extensions, preserving their calculations, task dependencies and output filenames.Reuse classification and correspondence API tables within each workflow execution, task list or single-task run; fetch afresh in subsequent runs. Share the API factory in the HTTP resource reader and forward request options to reads.
Standardize registered tasks to accept only config, moving legacy FAOSTAT year selections, UNIDO portal URLs and outlier settings into
Config. Check all registered task signatures in tests.Use a backend-maintained direct ISIC Rev.4-to-BONSUT activity correspondence for labour allocation. Add a validated bootstrap uploader and always fetch current backend mappings during labour collection, keeping their cache policy outside tasks. Retain source-output requirements for ambiguous mappings and reject stale target names.
Keep labour descriptors and provenance in supporting reports instead of repeating
extension_kind,metric,sex,skillandprovenance_fileon merged extension calculation rows. Leave the environmental compartment empty for labour rows.Combine emission and resource recalculation in
extensions.environmental.recalc_environment_extensionsand name the pre-balance merge modulemerge_environment_extensions. Preserve calculation bodies, workflow task names, dependencies, and output contracts.Move capital-account code to
extensions.economic.capital_investment_matrixand update workflow and CFC-script imports. Keep capital accounts separate from extension merging and retain their HIOT assembly, task names, and artifact contracts.Standardize the processed labour account and provenance paths to lowercase
labour, matching the collection account.Keep standard labour indicator names in terminated footprints; warn before report export when coverage by HIOT country/activity count is below 80%, retaining supporting coverage/gap reports instead of an
observed_contributionsuffix.Rename the b2 terminated footprint output to
terminated_elementary_flow.b2and update its exporter input to reflect the combined environmental and labour indicators.Rename the Python package
iLUCtoilucand its modules tomodel,land_use_calculations, andland_use_utils. Update imports while preserving theiLUC_modeltask name, calculations, and data-account paths.Rename the forestry module from
faostat.FAO_forestry_data_deftofaostat.fao_forestryand update its workflow import; keep calculations, task names, and outputs unchanged.Merge labour into the existing post-balance elementary-flow table with distinct identifiers/units and supporting coverage/provenance reports. Calculate environmental and explicitly labelled observed-contribution labour footprints in one b2 factorization and export them together in the existing terminated file. Climate characterization uses environmental rows only; exclude per-person rates and overlapping compensation skill totals, and do not represent missing labour as estimated zero.
Move
determine_supply_use_emissionfrom general utilities intoelementary_flows.emissions.generate_emissions_defand update its three internal callers without changing country-specific or generic coefficient behavior.Add four labour-account tasks implementing the ILOSTAT/Eurostat employment, working-hours and compensation method, with pinned source snapshots, same-country year selection, output-based activity allocation, fixed-total D1 skill splits and explicit coverage/provenance/conservation audits.
Place combined post-balance environmental and social extension assembly in
extensions.merge_extensions, withmerge_extensionsas the function and workflow task name; retain output contracts.Combine pre-balance emission and resource merging in one
merge_all_elementary_flowstask. Preserve emission-source precedence and finalelementary_flows_to_balanceexports while removing the intermediatetot_emissions_sutsfiles and combining all producer dependencies.Organize activity extensions under
extensions.environmentalandextensions.social. Place emission and natural-resource modules directly in the environmental package, labour in the social package, and capital directly in the economic package; retain pre-balance environmental merging inextensions.environmental.merge_environment_extensions. Preserve calculation bodies, task names, dependencies, and artifact formats.Move value-added preparation to
partial_SUTs.value_added.distribute_value_addedand add a post-balance task that restores detailed monetary accounts from saved pre-balance proportions. Keep gross GVA in the balance model, preserve signed source ratios, and export allocation exclusions and GVA reconciliation gaps separately.Migrate the remaining EXIOBASE caller to direct footprints and list only supported direct-solver engines.
Calculate b2 emissions and labour footprints and domestic/foreign GWP directly from the b2 technology matrix. Make footprints depend on HIOT assembly and iLUC emission merging; retain footprint output names and labelled axes.
Use PARDISO’s transpose-solve path for direct footprints instead of factoring the transposed HIOT as CSR; this restores production b1 residual accuracy without relaxing the backward-error threshold.
Print total elapsed time in seconds and hours after
Matrix.footprints()completes, including alignment, factorization, solves, and residual checks.Calculate b1 footprints directly from the technology matrix and elementary-flow extensions; stop generating or rereading the b1 inverse while retaining the GHG CSV output format.
Add labelled float64 demand solves and direct extension footprints to
Matrix, with explicit PARDISO, SuperLU, and optional UMFPACK backends, one factorization per operation, and residual checks.Move exploratory project and LCI integration scripts out of the installed package into
scripts/.Document production-only technical constraints and flag the unresolved producer-price selection in monetary footprint conversion for review.
Clarify skipped upper IO-ratio constraints with activity and flow codes, country, units, and the near-zero value instead of reporting zero production supply.
Reclassify incomplete sectoral heat markets as
M_heat_otherand revise UN final-energy allocation when activities lack a usable heat or electricity market.Redistribute bituminous-coal supply and use between other bituminous and sub-bituminous coal, then rescale nuclear-fuel production and market inputs to modeled demand before ore adjustments.
Calculate faeces treatment demand from food dry matter, include household, government, and non-profit food consumption, exclude non-food uses, and correct municipal versus industrial residual-waste inputs.
Route silkworm-cocoon production to textiles instead of garments, exclude unmapped food-LCI inputs from aggregation, and exclude pulp from final monetary-key redistribution.
Add pre-balance supply/use discrepancy analysis and retain units in optional workflow-evolution comparisons.
Export an offline interactive HTML chart when extracting activity supply evolution, with clickable series, hover values, zoom, and an optional output path.
Compose workflow price paths explicitly with the configured run date instead of resolving the latest price version through
PathBuilder.prices; remove the unused price-directory property.
Version 0.35.0#
Enhancements
Make the iLUC workflow task own source-table and classification loading, intermediate exports, and emission exports. Pass parameter DataFrames through calculation helpers, calculate country fertilizer factors once, and map transformation emissions in memory before writing. Retain existing intermediate artifacts for analysis compatibility.
Add regression checks for iLUC task-owned IO, single artifact writes, land-market conservation, fertilizer emission values, backend mapping, and country/activity supply alignment.
Extend Ipopt and Gurobi balance time limits to 8,000 seconds and rebuild the SUT graph before balancing when running the balance module directly.
Remove unused correspondence reads from non-food agricultural allocation and update analysis scripts for the current land-footprint entry point.
Retain hemp fibre and seed through the detailed principal-product list and aggregate both to
C_Hempdthrough the existing SUT mapping, preserving seed-only WM production without crop-specific Python logic.Require production and market activities to have a connected reference-product output with a positive finite value in its characteristic unit. Keep node validation local; graph validation and fixed-point pruning own the reference checks, while retaining input-only final demand.
Use unique backend FAOSTAT activity correspondences for iLUC land allocation instead of the obsolete animal-mapping workbook; add a preview-first uploader for the seven pasture labels. Align b2 land inputs to after-balanced and iLUC supply activities, export excluded rows for audit, and validate retained inputs.
Retain waste-stock treatment services in capital formation and supply while excluding them from allocated capital use; carry their full capital-good output into stock-addition final demand.
Sum merged elementary flows by UUID, country, activity, compartment, and unit after conversion, including resource flows with missing compartments.
Resolve emission coefficients under
collect/Emissions_coeffsand use the relocatedGWPs/lcia.xlsxworkbook.Include harvested-crop and used-residue CO2 uptake in the merged elementary-flow account, mapping both current and legacy resource labels to the uptake flow.
Add a sparse consumption-driven value-added analysis that splits balanced
fec_B1Gcontributions between domestic and foreign production.Keep HIOT diagonal and zero-column checks sparse to avoid allocating dense square matrices during assembly.
Write augmented b2 final demand to
final_demand.b2without overwriting the balanced b1final_demand_ABartifact, and read the b2 artifact in downstream exports and analyses.Write the b1 GHG footprint CSV and its report entry to
check_datainstead of HIOT, and read it there in downstream analyses.Apply product-balance constraints to the previously exempt market products, subject to the existing unit and initial-imbalance skips.
Name Brightway export directories by BONSAI data version instead of export date.
Keep both iLUC comparison years in the revised land-use account; split permanent and temporary pasture by eligible livestock revenue using fixed 2016 prices instead of CONCITO pasture weights, then allocate annual arable and grassland market additions using positive weighted-area changes for expansion and current occupied area for intensification.
Match forestry’s global forest-land input to annual managed-forest additions supplied by the iLUC market.
Validate b2 world-demand supply gaps when assembling the HIOT and export a product-level audit table before inversion.
Upload the complete tier-one contribution table instead of a fixed row slice that omitted recipes and land-market inputs.
Sum duplicate elementary-flow rows in tier-one direct contributions to match footprint totals, and exclude contributions with missing emissions.
Apply matched UN physical-to-tonne factors to units without scale words, and correct the hecto prefix from 1000 to 100.
Combine magnitude and metric prefixes when converting UN volume units, correcting hundred/thousand hectolitres and thousand kilolitres to their litre-based quantities.
Preserve UN rows in their original units when no physical-to-tonne conversion factor is available.
Integrate FIGARO monetary supply, use, final demand, and value added with OECD fallback in the monetary SUT workflow; use the merged tables for technical and distribution coefficients.
Add UNSTAT macro-category value-added loading for the monetary SUT workflow.
Add provisional product-level capital lifetimes and use 90% lifetime coverage as a transition proxy for capital use until historical capital accounts are available; allocate this target by CFC shares and carry the remainder into an auditable stock-addition account and b2 GFCF final demand.
Derive GFCF formation and capital eligibility from balanced characteristic-unit use, so pruned or adjusted pre-balance demand does not enter capital accounts.
Raise Gurobi’s failed numerical status before loading a solution, and use higher numerical focus for balance solves.
Log failed workflow tasks with their traceback and propagate the original exception to callers.
Resolve workflow data paths directly under
_b Next versionafter removal of theExiobase_4directory layer.Build the release wheel directly from the monorepo source tree so CI does not rebuild it from an incomplete source archive.
Expand each allocated capital product into its own capital-forming activity and capital-good product, with formation and industry-use accounts in
Useand reference supply inSupplyfor the b2 HIOT; print the reconciliation summary without exporting the intermediate allocation or an audit JSON file.Strip each
M_prefix when naming capital goods and forming activities, including every member of concatenated product codes.Add a preview-first script to upload generated capital goods and forming activities to the product and activity classification APIs, naming products with a
(capital goods)suffix and linking each activity to its capital product.Keep gross value added (
fec_B1G) in the balance account without subtracting consumption of fixed capital; the provisional capital-use fraction applies only in the b2 accounts.
Known limitations
Nuclear-fuel market supply can greatly exceed modeled use: UN uranium production is converted with an enriched-fuel energy factor, recorded trade removes little of that production from some domestic markets, and energy-product balance is not constrained. The new nuclear-fuel rescaling step adjusts supply and market inputs to modeled demand; its effect on these previously observed gaps still requires a workflow rerun and artifact validation.
Version 0.34.1#
Enhancements
Bumped BONSAI version to v2.4.1.
Estimate packaging-waste treatment and industrial metal reuse, and keep these flows distinct from ordinary waste-treatment markets.
Rework waste-market supply, imported waste-service allocation, and treatment mixes, including residual waste fractions and sorting flows.
Split fertilizer-market construction into registered workflow tasks for nutrient content, availability, input mixes, supply, and by-products.
Add iron-ore production from USGS data and estimate missing mineral and non-ferrous-metal supply.
Estimate missing monetary-SUT distribution coefficients and correct their downstream path and product mappings.
Generate the hybrid capital use table after balancing and include it with iLUC in the b2 HIOT; the pre-balance hybrid SUT no longer includes capital use.
Export the b1 extended HIOT matrix again and run the elementary-flow and footprint stages when their modules are executed directly.
Scale transport margins for stone by-product markets to the remaining market supply after by-product supply is moved outside the market.
Apply activity-balance bounds to fertilizer markets and include phosphorus and PK fertilizer products in price balancing.
Reject missing or non-boolean
relation_plausibleresponses instead of treating them as implausible relations.Resolve
bonsai-apiandbonsai-exportfrom their Git package subdirectories pinned tobonsai-io-v0.34.0, allowing installation without separately publishing these sibling packages to a package index.Normalized IO-ratio constraint coefficients by initial reference supply and enabled Gurobi constraint-matrix scaling (
ScaleFlag=2).Set the extreme initial product-imbalance skip threshold to 10 and the near-zero tolerance for product and lower activity balances to
1e-7.Added Pint definitions for
m3andSm3and separate cubic-metre and standard-cubic-metre export labels in the post-balance elementary-flow merge; density-based conversion remains selected by differing dimensionalities.Updated area-time unit handling in the elementary-flow merge for square-metre-year export labels.
Connected manually revised use tables to downstream transfer-coefficient, metabolism, packaging, and waste tasks so workflow reruns propagate corrected inputs.
Removed deprecated global-market missing-production helpers.
Mapped elementary-flow emissions to each activity’s diagonal reference product in tier-one footprint contributions, preventing cow-milk emissions from being assigned to cattle products.
Version 0.34.0#
Enhancements
Added a transferable, code-independent price-model trainer using supply locations and product/activity names.
Bumped the default BONSAI data version to
v2.4.0.Added source docstrings for every registered workflow task and a script that exports them in deterministic dependency order.
Grounded local-LLM technical-constraint reviews in validated cross-country peer statistics, explicitly considered capital inputs during relation review, and added deterministic decision reasons and approval-score caps for single-observation or incomplete evidence.
Converted implausible product/activity relation reviews directly into approved numerical-zero technical constraints with bounds
[0, 1e-5].Added capped technical coefficients for value added and applied them through the standard IO-ratio constraints.
Replaced initialization-point infeasibility dumps with Gurobi IIS reports and stopped balance exports when the solver does not return an acceptable solution.
Adjusted the default correspndence for water release from “release to air” to “release to water”.
Updated the water-cooling methodology to describe the thermal-power cooling dataset and plant-capacity based coefficient calculation.
Simplified monetary SUT gapfilling by removing the legacy gapfill implementation and using the configured workflow year for similar-country proxy selection.
Moved the land-footprint final-demand selector into the land-footprint module that consumes it.
Ordered concatenated Bonsut monetary activity codes before writing them, preventing string-order mismatches between monetary supply and use tables.
Updated monetary SUT country gapfilling to use GDP weighting for similar-country proxies.
Improved monetary SUT similar-country gapfilling with deterministic ISO3-based metadata mapping, regional and income-group donor selection, GDP-per-capita and population similarity scoring, and similarity-weighted GDP scaling without a China fallback.
Reworked monetary SUT gapfilling to estimate principal supply first from GDP-scaled, similarity-weighted donors, then derive intermediate-input and value-added ratios from activity output and final-demand ratios from product supply.
Corrected missing-country intermediate-use gapfilling to preserve every donor input product by calculating its ratio against activity output instead of requiring a matching product supply row.
Removed gapfilled supply activity-country pairs without corresponding nonzero use, preventing donor-only activities from remaining in the monetary SUT supply output.
Deferred BONSUT regional location aggregation until all monetary SUT accounts are gapfilled, then harmonized every account to the shared BONSUT location domain, including mapping BONSAI-only locations such as
SGintoWA.Split service-trade values equally when one product matches multiple destination markets instead of assigning the full value to the first market.
Added direct OECD monetary SUT loading from the configured clean CSV files, with explicit CPA product and ISIC activity concordance mapping and workflow registration before MSUT building.
Refactored OECD monetary SUT ingestion into dedicated split, load, and build utilities.
Corrected the OECD monetary workflow to use the intended value-added account and updated its reconciliation.
Updated average-market construction to consume the consolidated bilateral trade artifact, including aggregated service exports, without reloading raw service trade or double-counting currency trade.
Aligned multiregional-trade task dependencies with the artifacts consumed directly by the task, removing obsolete monetary-trade and total-trade dependencies.
Excluded Comtrade World, Free Zones, and Areas NES aggregates from bilateral service trade, and corrected Namibia’s fallback to the African rest-of-world region.
Added a script-generated
cfc_coefficient_by_activity.csvcapital data-collection evidence ledger for activity-level CFC per monetary unit of industry output.Updated capital investment allocation to calculate current activity-level CFC coefficients on the fly from prior and observation rows, then multiply them by current monetary output.
Renamed the generated capital-use artifact from
hybrid_capital_investment_table.csvtohybrid_capital_use_table.csv.Added a pre-balance elementary-flow merge task so the hybrid SUT build consumes one merged elementary-flow artifact instead of assembling natural-resource rows inline.
Split combustion-emission scaling from the final emissions merge so scaled combustion rows are produced separately and merged by
merge_all_emissions().Moved value-added processing into the disaggregation task and now use net value added (
fec_B1G - fec_COFC) as the elementary inflow, avoiding double counting while keeping capital consumption in its separate account.Corrected value-added task dependencies so the dedicated disaggregation artifact is consumed by graph conversion without creating a cycle through price and hybrid-SUT construction.
Merged the standalone emission-account merge module into the elementary-flow merge module.
Added disaggregated value-added rows to the hybrid SUT builder as elementary inflows.
Refactored pre-balance elementary flows to use one
elementary_flowaccount type withflow_directiondistinguishing activity outflows from activity inflows.Allowed signed initial use values in the balance model so negative value-added accounts can participate in monetary accounting while optimization variables remain non-negative.
Added bounded substance-to-reference-flow ratio constraints in the balance model, preventing value-added and other substance inflows from becoming unrestricted balancing variables.
Updated graph conversion and IO-ratio constraints to handle elementary-flow rows without product classification or product-only constraints.
Backward Incompatible Changes
Removed the
estimate_value_addedtask.Removed separate
emissionandresourceaccount types fromAccountType; pre-balance elementary flows now useelementary_flowwithflow_direction.
Version 0.33.1#
Enhancements
Restructured water accounts from broad
Water, no specific originandWater, greenflows into origin-specific elementary flows for unspecific, cooling, air, surface, ground, and green water across municipal services, livestock cleaning/feed, power generation, and crops.Split crop and livestock irrigation water coefficients into groundwater and surface-water substances, and mapped capillary-rise blue water to groundwater before post-balance recalculation.
Merged crop and forage-derived livestock water coefficients into
water_use_coeff_for_crops_n_forages.csvwith awater_use_sourcemarker.Moved water-coefficient generation into a dedicated
elementary_flows.water_defmodule and aligned crop/forage water coefficient exports onREF_PROD_CODE, elementary-flow UUID substances, volume units, stable coefficient columns, andwater_use_sourceprovenance.Added refinery products to the selected price-balance constraint set.
Tuned balance constraints by expanding selected price-balance products, skipping product balance for energy flows, tightening extreme-imbalance skips, and narrowing selected activity, waste-service, and item-count price bounds.
Updated methodology documentation and diagrams for capital endogenization, water-use coefficient artifacts, and the basic-to-extended input-output transformation.
Streamed approved local-LLM technical-constraint reviews into
technical_constraints.csv, storing the review rationale in the constraint comment field.Added a helper script to populate
Exio ref. prod codeintechnical_constraints.csvfrom activity reference products.Added
bonsai-apias a runtime dependency, migrating API endpoint definitions into the standalone API client package instead of keeping them as abonsai-ioutility, while preserving compatibility imports forbonsai.io.util.connectorsandAPIEndpoints.Expanded the maintained
technical_constraints.csvdataset and cleaned up product price data.Split local-LLM technical-constraint review into relation and bounds stages, keeping impossible relations as
needs_reviewinstead of approving zero-bound constraints.Mapped PPF and own-consumed fuel inputs through combustion-process heat-market correspondences while keeping unmatched fuels on their original product code.
Wrote combustion-process emission coefficients to the active versioned emissions account and read the CSV source table directly.
Renamed technical-constraint candidate flow amounts from
candidate_valuetosource_valueand clarified the local-review prompt semantics.
Backward Incompatible Changes
Removed unused
IndexNamesmembers for aggregation, substitution factor, and parent class metadata.Moved water coefficient task functions out of
bonsai.io.elementary_flows.natural_resource_elab; import them frombonsai.io.elementary_flows.water_def.Renamed the technical-constraint candidate CSV amount column from
candidate_valuetosource_value.Removed the split
water_use_coeff_for_crops.csvandwater_use_coeff_for_livestock.csvwater-coefficient outputs.
Version 0.33.0#
Enhancements
Bumped the default BONSAI data version to
v2.3.0.Moved ingestion of
hybrid_capital_investment_table.csvintobuild_hybrid_sut()so capital participates in graph conversion and balancing, while keeping iLUC land-use HIOT b2 construction in the HIOT assembly layer.Switched capital endogenization eligibility from country-specific intermediate-use links to a shared global use-derived product-by-industry matrix, while keeping GFCF amounts, CFC weights, output exclusions, and fallback allocation country-specific.
Updated capital endogenization eligibility and allocation to use the pre-balance use table, preserve raw intermediate-use activity codes, including concatenated
A|Bcodes, and project CFC from matching BONSAI member industries onto that raw activity axis.Added IEA-derived coal-product shares to disaggregate aggregated hard-coal and brown-coal entries in UN energy supply, electricity and heat use, own consumption, trade, final consumption, transformation, and non-energy use accounts.
Updated UN energy heat handling to use hot-water heat activity coding, validate duplicate electricity and heat supply rows, and convert biogasification-derived manure and waste energy outputs to mass units before exporting supply rows.
Updated balance optimization to use sublinearly weighted relative squared deviation, revised selected product price-balance sets, tightened or relaxed selected activity and price variation bounds, and aligned HIOT use columns to supply columns so supply-only activities remain valid structural-zero use columns.
Fixed an issue with unit conversion for wood and forest natural resources.
Fixed capital investment table unit assignment so excluded GFCF products no longer shift units onto later capital products.
Improved capital account mapping for activities.
Expanded balance price constraints to every priced product, including mass-unit products, so physical product flows are constrained by their monetary price relationships during balancing.
Removed the legacy Excel-based iLUC substance-name normalization before elementary-flow UUID mapping, so iLUC emissions now rely on the backend elementary-flow correspondence as the source of truth after the explicit
NO3toNrule.Moved iLUC land-use product/activity-code normalization into the iLUC account build, with the task consolidating technosphere rows into
iluc_use.csvandiluc_supply.csv, mapping product columns against product classifications and activity columns against activity classifications, and failing fast on unmapped labels so downstream HIOT tasks consume validated iLUC rows.Moved remaining active helpers out of broad utility modules into their consuming modules and removed obsolete HIOT/iLUC/IOT helper code and the old iLUC comparison script.
Backward Incompatible Changes
Removed the
footprint_def.add_b2_account_to_hiot()wrapper; callhiot.assemble_df_for_hiot.generate_hiot_b2_tables()for b2 HIOT construction.
Version 0.32.0#
Enhancements
Added UN energy data ingestion and comparison tasks, including cleaned use-account inputs, electricity and heat supply estimates, refinery feedstock extraction, energy-flow trade, own consumption, final consumption, and stock-change accounts.
Added UN-derived production estimates for electricity, heat, refinery feedstock, chemicals, virgin plastics, waste incineration, and biogas-related energy flows, with task-registration updates to wire them into the supply and use workflow.
Added water-use and natural-resource coefficient workflows for crops, forages, livestock cleaning, thermoelectric plants, aquaculture, fertilisers, and post-balance water-footprint recalculation, with matching methodology documentation.
Updated BACI, Comtrade, and forestry trade handling, including collected-data path cleanup, refined BACI trade treatment, and conversion-factor support for forestry products.
Updated market and waste integration so market supplies without margins, waste-market mixes, sorting activities, secondary-material estimates, and reclassified energy products are integrated consistently in supply/use tables.
Added backend ingestion support for BONSAI-to-CN/CPA/CPC/BONSAI product correspondence data.
Aligned Stone-market HIOT generation, footprint, contribution, aggregate-footprint, final-demand footprint, household-use, post-balance checks, SimaPro export, and Brightway export readers on the versioned HIOT working directory.
Moved current emission-generation and recalculated elementary-flow inputs/outputs onto versioned
emissionsandBalancedaccount directories, keeping post-balance elementary-flow merging on the active workflow date.Folded final-demand vector extraction into
balance_sut(), writingfinal_demand_ABalongside the generated HIOT artifacts instead of relying on a separate downstream task.Fixed secondary-material estimate helpers so collected-waste rows append the per-country estimate frame and missing rows are concatenated with valid pandas inputs.
Fixed API pagination handling so HTTPS endpoints keep using HTTPS when backend
nextlinks are emitted as HTTP, and non-JSON API responses now report status, content type, and a body preview.Updated price gapfilling to read and write versioned
pricesaccount artifacts and fail fast when product descriptions are missing.Updated the default workflow configuration date to
2026-06-15.
Backward Incompatible Changes
Removed the legacy
SQLiteResourceRepositoryimplementation; resource tracking now stays on the CSV-backed repository path.Removed legacy
PathBuilderaccessors for old HIOT raw, b2, and investment-matrix folders; callers should use versioned account paths instead.Removed the in-package
bonsai.io.agriculturehelper package after moving the legacy agriculture helpers out of the package runtime surface.Removed the standalone
select_fd_vector_after_the_balanceworkflow task because final-demand extraction now happens during balancing.Removed obsolete footprint heat-market decomposition scripts and helper modules after dropping the remaining checked-in script imports.
Cleaned up old final-SUT disaggregation code, stale imports, deprecated global-market task comments, and unused rough-analysis variables.
Version 0.31.2#
Enhancements
Moved heat-market supply and input artifacts into the versioned Supply and Use account folders, and renamed the energy-market module to
energy_market_def.Reallocated passenger-car fuel use from land-transport fuel markets into
M_fuel_Passengerusing cleaned JRC road-transport fuel shares.Aligned energy, PPF, price, market, and emission readers with versioned account paths so task outputs are read from the active workflow date.
Kept packaging-manufacturing use estimation compatible with the versioned heat-market account outputs.
Added household country-recipe validation against the latest backend recipe download, including inflow and emission value comparisons.
Backward Incompatible Changes
Removed obsolete EXIO data-check notebooks/scripts and the unused legacy HIOT SimaPro helper module.
Version 0.31.1#
Enhancements
Release of BONSAI v2.2.0.
Added an optional local Ollama review workflow for technical-constraint candidates, writing review CSV and JSONL history artifacts without mutating authoritative constraints.
Included raw water-use rows in the recalculated elementary-flow merge and normalized current-unit aliases before dimensional unit conversion.
Centralized elementary-flow UUID mapping in the recalculated elementary-flow merge/finalization task, so upstream recalculation artifacts can keep raw labels while the final merged output remains UUID-keyed with
substance_name.Updated footprint validation to fetch benchmark rows through the authenticated footprint CSV download API, avoiding paginated JSON limits while preserving the comparison output schema.
Changed the default balance solver from IPOPT to Gurobi and kept solver-status validation for failed or unusable solves.
Exposed
Property.is_characteristicin pandas account exports and used it directly when extracting characteristic supply and use rows after balancing.Set
Property.is_characteristicwhen graph flows are inserted, keeping account exports side-effect-free and using the stored characteristic layer for IO-ratio constraints.Made exporter classification inputs explicit on the SimaPro and Brightway input models instead of wrapping them in a dedicated classification aggregate.
Renamed the exporter data object’s elementary-flow classification attribute to distinguish source classification metadata from runtime elementary-flow tables passed through
bonsai-ioexport tasks.Fixed SimaPro export task.
Simplified the legacy carbon-footprint benchmarking scripts by removing unused outlier-analysis helpers and unused imports.
FIxed an issue with the unit of nuclear fuels.
Backward Incompatible Changes
Cleaned up un-used scripts and tasks related to waste.
Removed stale standalone scripts for connector examples, empty household-energy analysis, legacy EXIOBASE v3 waste-use import, and bottled-water production experiments.
Version 0.31.0#
Enhancements
Consolidated capital-investment calculation into the
capitalmoduleDerived country-specific GFCF eligibility from positive intermediate-use links, with CFC fallback allocation and row-total validation.
Simplified country and product aggregation with vectorized pandas operations
Switched monetary-output calculation to the gap-filled product-price dataset.
Added balance-solver status validation and Gurobi solver support, and expanded product-balance coverage for market products.
Deprecated
_retrymechanism as it intricically cannot overcome local optimum.
Version 0.30.4#
Enhancements
Release of version 2.1.7.
Standardized elementary-flow substance handling on
IndexNames.SUBSTANCE, replacing the emission-specific substance enum across emission generation, recalculation, iLUC, HIOT, and footprint readers.Added harvested crop land-use rows to the recalculated elementary-flow merge, mapping crop occupation to the elementary-flow UUID and converting harvested area to square-meter units.
Included recalculated crop CO2 absorption as an upstream input to the merged elementary-flow workflow.
Cleaned up obsolete emission-generation helpers and aligned the remaining emission coefficient outputs with the unified elementary-flow substance schema.
Updated final-demand footprint selection so gross fixed capital formation is included with other final consumers.
Added pasture/meadow land-use recalculation to the post-balance elementary-flow merge, mapping FAOSTAT pasture resources to elementary-flow identifiers and exporting them with the recalculated elementary flows.
Moved PPF proportional-output emission coefficient generation into the initial emission-generation stage and wired it before the post-balance PPF emission recalculation task.
Renamed the iLUC-augmented elementary-flow artifact from
total_abs_emissions_with_iLUCtototal_elementary_flow_w_iLUCacross footprint, contribution, aggregation, and export readers.Renamed Brightway export metadata output from
metadata.jsontoio_metadata.json.Fixed pasture-land recalculation workflow registration to use the elementary-flow module that owns
recalc_pasture_land_use.Removed obsolete
IndexNamesenum entries that are no longer used by the workflow.
Version 0.30.3#
Enhancements
Added the simple PPF generation task, including production-volume and coefficient uncertainty sampling, best-fit distribution metadata, and optional property balancing for generated use, supply, emission, resource, and product-property outputs.
Added PPF utility helpers for BONSAI/IPCC schema conversion, code and unit normalization, trade-share aggregation, missing production-volume completion, and constrained property balancing.
Ensured PPF product-property outputs are exported whenever available, including datasets without resource outputs, and consolidated the PPF task export path handling.
Skipped simple PPF task execution when production-volume or coefficient inputs are empty, and removed the unused
shares_dfargument fromppf_simple().Updated PPF supply, use, and emission loaders to read the CSV outputs written by the simple PPF task from the clean PPF directory instead of the legacy
_BONSAI_data_testresources.Moved simple PPF country iteration into
build_simple_ppf(), so task configs no longer need to provide a single country.Switched the
bonsai-classificationsdependency to install directly from the BONSAI classifications source repository.Documented the remaining hard-coded
_BONSAI_data_testComtrade services input path as pending migration to the bonsai-io resource repository structure.Added a minimal passenger-car share allocation that moves matching
A_TLNDfuel use intoF_HOUSbased on available JRC road-transport use by country and fuel.Added a
skip_tasksoption to workflow multi-task execution so selected tasks can be omitted fromrun_tasks()andexecute()runs.Wired heat-market separation to the cleaned JRC transport fuel-use task so passenger-car fuel allocation uses the workflow-generated BONSUT transport input.
Version 0.30.2#
Enhancements
Aligned
total_abs_emissions_with_iLUCreads and writes on the sharedpaths.hiot_intermartifact path across footprint post-processing, contribution analysis, export tasks, and aggregated-account helpers.Kept HIOT final-demand assembly aligned with the hybrid post-balance tables while moving the standalone selection helper into the updated HIOT assembly flow, so direct balanced final-demand exports stay available to downstream export steps.
Extended
src/bonsai/io/elementary_flows/recalc_elementary_flows.pyso the final merge now includes backend property-aware unit conversion for balanced elementary flows and appends a readablesubstance_namecolumn derived from the BONSAI elementary-flow classification.Updated the direct
recalc_elementary_flows.pymodule entrypoint to run the full balanced elementary-flow regeneration sequence, including fuel-and-wood extraction, before merging outputs.Renamed the iLUC post-processing workflow task from activity-emissions wording to elementary-flow wording.
Marked
src/bonsai/io/hiot/generate_hiot_for_simapro.pyas a legacy path pending replacement by the shared exporter pipeline, and cleaned up unused imports and dead test helpers around version/config fixtures.
Backward Incompatible Changes
Changed tier-1 direct elementary-flow contribution rows to use the activity country in
contrib codeinstead of the historicaldirectmarker, aligning direct contribution rows with the regional contribution code shape.Switched
src/bonsai/io/monetary_sut/gap_fill_table.pyto usebonsai.io.Configinstead of the legacydataio.config.Config, keeping the standalone MSUT gap-filling entrypoint on the package-local configuration API.Removed obsolete test-only config/version fixtures and the legacy
_terminated.ipynbhelper from the repository as part of the ongoing exporter and workflow cleanup.
Version 0.30.1#
Enhancements
Merged balanced resource extraction into the final elementary-flow finalization step while keeping
extraction_of_resources_ABas a standalone intermediate export, and now publish the unified balanced elementary-flow artifact asall_elementary_flows_AB_and_BB.Mapped balanced fodder CO2 capture through the BONSAI elementary-flow classification in
recalc_elementary_flows, rewired the workflow to use that mapped implementation, and includedco2_capture_grass_fodder_ABin the mergedall_elementary_flows_AB_and_BBoutput.Fixed MSUT file discovery so
build_msut()matches staged supply files by filename and the downstream monetary SUT import path remains compatible with stagedloadartifacts.Renamed the Brightway export task input from
emissionstoelementary_flowsinsrc/bonsai/io/export_tasks.py, aligning the task-layer contract with the full elementary-flow table it passes intobonsai-export.
Backward Incompatible Changes
Removed
tqdmfromsrc/bonsai/io/util/validate_ecoinvent_helpers.pyto simplify the ecoinvent validation helper runtime path.Renamed the balanced final elementary-flow artifact from
all_emiss_AB_and_BBtoall_elementary_flows_AB_and_BB; downstream readers now consume the unified emissions-plus-resources dataset under the new name.Removed
generate_tidy_io.pymodule in favor ofbonsai-exportfor Brightway2 format export.Code clean-up for maintainability.
Version 0.30.0#
Enhancements
Added elementary-flow classification and correspondence API endpoints to
schema_enums, and exposed them throughclassif_repositoryandcorr_repository.Moved elementary-flow mapping for
all_emiss_AB_and_BBintomerged_parametric_emissions, so the balanced emissions dataset is written with merged"{substance}, {compartment}"correspondence lookup applied at export time.Switched emissions and footprint runtime identifiers from ecoinvent
source_idto BONSAI elementary-flowuuid, while keepingsource_idonly as external mapper metadata in the elementary-flow classification.Kept
Accelerated CO2, Airas a temporary BONSAI-specific elementary-flow alias with aFIXME, while other unresolved merged tokens still fail fast.Switched contribution analysis climate characterization to the UUID-keyed
LCIA.xlsxlookup used bycalculate_ghg_footprint(), soall_emiss_AB_and_BBandtotal_abs_emissions_with_iLUCremain characterizable after the runtime identifier change.Hardened contribution-side B-matrix normalization for small dense intermediate results produced during direct-emission characterization.
Updated export task inputs to pass elementary-flow classification data through to exporters, so UUID-keyed internal emissions can be resolved back to source elementary-flow metadata during export without reintroducing exporter-side flow subsets.
Kept exporter-facing elementary-flow identifiers aligned with the internal
Exio substancevalues, while exposingsource_idonly as auxiliary metadata for external ecoinvent mapping.Aligned SimaPro-facing terminated-emissions inputs with the same raw
Exio substanceidentifier semantics used for direct emissions, so downstream export no longer depends on compartment-qualified hard-coded BONSAI flow keys.Flattened the former
emissionsandnatural_resourcescode intosrc/bonsai/io/elementary_flows/as the new canonical namespace, without changing task ordering or data contracts.
Version 0.29.2#
Enhancements
Prefixed Sphinx auto-generated section labels with document names to avoid duplicate
autosectionlabelwarnings across documentation pages.Adjusted the export task for SimaPro and removed metadata for basic to purchasers’ price, as it is redundant.
Refined the Quality Assurance section in
docs/methodology.mdto clarify the balancing framework, technical constraints, trade-production cross-validation, emissions validation, anomaly screening, and benchmark-based release checks.Other refinement for methodology documentation.
Fixed explicit MyST cross-reference targets in
docs/methodology.mdfor methodology section links.Renamed the SimaPro export metadata field from
basic_pricestopricesinsrc/bonsai/io/export_tasks.pyand the paired exporter input models so the task layer passes the unified price dataset without implying basic-vs-purchaser price semantics.
Backward Incompatible Changes
Removed deprecated scripts for maintainability.
Version 0.29.1#
Enhancements
Updated
src/bonsai/io/export_tasks.pyto build explicit Brightway and SimaPro export input bundles instead of passing a path-driven exporter context.Moved Brightway default output-path selection fully into the
bonsai-iotask layer so exporter input bundles contain only BONSAI source data.Normalized SimaPro
basic_pricesin the task layer before constructing exporter metadata inputs, keeping export-time data contracts explicit.Expanded
docs/methodology.mdwith a quality-assurance section under data sources, documenting the main validation controls used insrc/bonsai/ioto support footprint validity.
Version 0.29.0#
Enhancements
Split packaging into
packages/bonsai-io(core) andpackages/bonsai-export(export layer).Added
bonsai-exportas a runtime dependency and moved SimaPro/Brightway export task registration intosrc/bonsai/io/task_registration.py.Added
src/bonsai/io/export_tasks.pyto build exporter context fromConfigand invoke export converters.Added symmetric editable install workflow for both packages from the monorepo.
Updated installation documentation for two-package development setup.
Merged onboarding docs into root
README.mdand renamed docs page slug fromreadmetogetting-started.Migrated test/lint configuration from root
setup.cfgintotox.ini.Fixed editable install metadata for
packages/bonsai-ioandpackages/bonsai-exportby configuringsetuptools-scmto resolve version from the repository root.Removed cross-directory
long_descriptionfile references in package metadata to satisfy setuptools editable build constraints.Added package-specific SCM tag parsing and CI release rules for independent versioning:
bonsai-io-vX.Y.Zbonsai-export-vX.Y.Z
Constrained SCM tag discovery for package builds so
bonsai-ioparses onlybonsai-io-v*tags (avoids editable install failures when unrelated tags are present).Migrated historical release notes from
docs/CHANGELOG.mdintopackages/bonsai-io/CHANGELOG.md.Changed docs release notes landing page to a dropdown selector linking to dedicated per-package changelog pages.
Reworked release notes docs navigation to use nested toctree pages so package changelogs can appear as navbar submenu entries.
Added Brightway2 exporter
bw2as an optional dependencyRemoved dependency on
bonsai-dataiotemporarily as a fix tonumpydependency conflict.Updates on documentation.
Backward Incompatible Changes
Moved exporter code namespace from
bonsai.io.exporttobonsai.export.Removed root package build files (
setup.cfg,setup.py); repository root is no longer installable.
Version 0.28.5#
Enhancements
Tightened activity balance for energy flows.
Bugfix related to recycling activities.
Bugfix for correspondence table between BONSAI and BACI HS07.
Fixed an error in exporting to SimaPro.
Improved documentation.
Backward Incompatible Changes
Removed unused scripts and functions.
Version 0.28.4#
Enhancements
Fixed bug in task dependency.
Fixed a bug in by-product modelling related to trade and transport margins.
Improved technical constraints and prices.
Improved emission coefficients for PPFs.
Added benchmark against EDGAR.
Fixed bug related to South Africa’s trade account.
Bumped Dependency to Numpy 2.0.x.
Merged
iomodule withresourcesmodule.Added retry mechanism to API client.
Version 0.28.3#
Enhancements
Added regional electricity market.
Fixed an error in emissions classification that leads to over-estimate of methane emissions.
Pre-calibrated SUTs using technical constraints before balance.
Re-introduced product balance.
Replaces price before balance with price after balance for calculating monetary footprint.
Deprecated file-based reference product identification in favor of data from activity classification API.
Added a temporary fix for fuel trade.
Fixed correspondences for waste treatment.
Added final demand node to graph as a special kind of activity node.
Added
kwargsforWorkflow.run_tasks()to enableforce_runforTask.run().
Backward Incompatible Changes
Removed unused scripts and functions.
Migrated functions for constructing symmetric SUT into the same place.
Deprecated
gapfill_price_w_recipein favor of direct gapfilling with ML.
Version 0.28.2#
Enhancements
Integrated with technical constraint API and outlier detection to enrich technical constraint dataset.
Added technical constraints for multiple activities.
Adjusted data priority to favor manually collected data over statistical data for price.
Improved the price dataset and tightened price constraint.
Deprecated flow constraints in favor of variable upper and lower bounds for faster model construction.
Other bugfixes in SUT compilation.
Added a demo 3-way graph reconciliation utility at
src/bonsai/io/balance/graph_opt.pyto mergeG_base,G_upstream, andG_opt, syncing upstream structure and propagating upstream numeric deltas.
Version 0.28.1#
Enhancements
Added technical constraint data.
Adjusted the export directory for SimaPro exporter.
Merged the input technical constraint and by-product technical constraint dataset.
Adjusted prices estimation algorithm for gapfilling.
Added price constraints in balancing.
Backward Incompatible Changes
Removed unused scripts and functions.
Version 0.28.0#
Enhancements
Release BONSAI v2.1.1.
Enhanced balance with bounded technical coefficients.
Used
setforActivityNode.inflowsandActivityNode.outflowsto replacelist. Improve performance and memory efficiency (O(1) add/remove)Improved performance of
_remove_nodeusing the node’s adjacency sets instead of scanning all flows.Enforced object↔activity-only flow connections in
SUTGraph.add_flow.Removed pandas usage for balance model account construction to reduce model build overhead.
Added property-level warm-start persistence and reuse for balance model variables.
Unified balance graph persistence into a single
sutgraph.pklwith warm-start carryover.Sped up inverse assembly by writing directly to a memory-mapped matrix on disk.
Moved data clean for The Big Climate Database to
lcimodule.Moved the transformation of rectangular SUT to square SUT to before balance.
Added SimaPro exporter.
Fixed an issue with by-product market.
Simplified symmetric SUT construction.
Adjusted the list of extraction activities.
Added and revised technical constraint data.
Backward Incompatible Changes
Removed unused scripts and functions.
Removed some non-essential data tests in favor of in-line data validation.
Version 0.27.0#
Enhancements
Bugfix for contribution analysis.
Disaggregated contributions from direct elementary flows.
Bugfix for market construction.
Bugfix for transport and trade margins.
Added new tasks for by-product replacing.
Added new task for SimaPro-compliant format.
Bugfix for zero-footprint in by-product market.
Modified approach for household disaggregated footprint.
Added method in
Matrixto detect circular dependency error.Fixed
PathBuilder.prices.Adjusted by-technology modelling approach from market products to industrial products.
Fixed mass balance for fertilizer market.
Updated prices for FAOSTAT data.
Fixed an issue with technical coefficients for sorting activities.
Improved documentation of methodology.
Backward Incompatible Changes
Removed unused utilities.
Removed unused tasks related to market.
Deprecated
paths.hiot_with_iluc.
Version 0.26.2#
Enhancements
Released V2.0.2.
Migrated a component of the household-disaggregation pipeline from R to Python.
Introduced an aggregated “average household†profile for all countries/regions where detailed household-level disaggregation is available.
Bugfix related to intensification of cropland.
Bugfix related to waste treatment services.
Bugfix related to fertilizer market.
Better technological modelling with more technical coefficients.
Updated documentation.
Backward Incompatible Changes
Deprecated bugfixing task:
revise_coproduction_of_pulp_industry,revise_unit_of_waste_services,determine_direct_emissions,scale_up_combustion_activities.Removed ununsed utilities.
Version 0.26.1#
Enhancements
Fixed schema change for final demand footprint.
Removed partial aggregation in contribution analysis.
Other updates for database connection.
Backward Incompatible Changes
Cleaned up configuration parameters.
Deprecated unused tasks.
Version 0.26.0#
Enhancements
Fixed final demand account in
generate_fd_b2.Replaced
flow_typefrom activity classification fromproducttoindustry.Adjusted
create_average_marketfor flexible monetary market composition.Improved
Connector.putfor product correspondence.Changes for flexible market and descriptions.
Bugfix for nuclear fuel trade.
Added transfer coefficient constraints in balance.
Added validation against Ecoinvent data.
Adjust technical coefficient constraints in balance.
Improved documentation for balance.
Backward Incompatible Changes
Deprecated
generate_hiot_for_simapro.Other deprecations for unused tasks.
Version 0.25.1#
Enhancements
Fixed documentation format for glossary.
Expanded methodology documentation for sector modelling, balances, and consequential workflows.
Expanded methodology overview with inline table of contents and references.
Rewrote documentation getting-started guide for environment setup.
Improved
Nodevalidation.Added
SUTGraph.pruneto prune invalid nodes.Added on-page feedback buttons to collect quick GitLab reactions.
Added footprint validation before loading into database.
Backward Incompatible Changes
Removed un-used functions in capital endogenization.
Removed un-used tests.
Version 0.25.0#
Enhancements
Added parametric constraints in balancing.
Bug fix for the task
create_average_markets.Improved code readability.
Added
descriptionfield toNode.Improved monetary SUT workflow.
Added agent instructions.
Improved functionality of
Connector.post.Security update.
Backward Incompatible Changes
Removed un-used files in documentation.
Version 0.24.4#
Enhancements
Added a single task for building domestic mix.
Refactored load PPF tasks for batch ingestion.
Integrated gapfilling into the workflow.
Added trade of services.
Improved documentation of PPF integration.
Backward Incompatible Changes
Deprecated domestic mix for each product.
Version 0.24.3#
Enhancements
Fixed integration of coke in the waste account.
Renamed
asses_waste_from_stocktocalc_waste_stock_variation.Added all accounts for monetary supply and use tables.
Fixed task dependencies for MSUT-related tasks.
Minor fix for PPF integration documentation.
Added
load_ppf_emissionas a task.Renamed coke related tasks to ppf tasks.
Backward Incompatible Changes
Deprecated a few utility functions.
Depreacted a few un-used functions in the
agriculturemodule.
Version 0.24.2#
Enhancements
Fixed national mix use of coke.
Used emission account after balance for footprint.
Excluded EXIOBASE monetary trade.
Fixed correspondence for cattle meat from Concito.
Fixed aluminum recycling by-product.
Backward Incompatible Changes
Deprecated task
distribute_remaining_use_with_monet_keys.Bugfix for integrating supply of coke PPF.
Deprecated un-used utilities.
Version 0.24.1#
Enhancements
Fixed monetary use distribution key.
Fixed location mapping from EUROSTAT to BONSAI.
Refactored integration of PPF supply.
Other bugfix and readability update.
Version 0.24.0#
Enhancements
Added internal Monetary SUT.
Improved workflow dependency.
Separated Leontif inverse and footprint calculation.
Fixed task for footprint in monetary unit.
Other bugfixes and code structure optimization.
Backward Incompatible Changes
Deprecated footprint-related tasks.
Version 0.23.4#
Enhancements
Added production and final demand footprint for GTP20.
Refactored tasks related to FAOSTAT to align with LCI structure.
Fixed tasks related to ILUC.
Other documentation and code readability update.
Backward Incompatible Changes
Deprecated footprint-related tasks.
Version 0.23.3#
Enhancements
Added topological sorting for
Workflowto avoid duplicated execution of tasks.Fixed task dependency issue.
Fixed
ryp2optional package dependency issue.Refactored contribution analysis for product-by-product IOT.
Fixed workflow not stop when task fail.
Other documentation update
Backward Incompatible Changes
Deprecated
Task.is_ready().Deprecated
Task.visual_task_dependency().
Version 0.23.2#
Enhancements
Improved algorithm for by-production technology modelling.
Improved algorithm for reference product identification.
Integrated household disaggregation into workflow.
Improved use table validation.
Other bugfixes and documentation.
Backward Incompatible Changes
Deprecated
BasePathsclass in favor of a singlePathBuilder.Deprecated
generate_prices_for_hiot.
Version 0.23.1#
Enhancements
Added price constraints to the balance.
Used
dataio.resources.ResourceRepositoryinstead ofdataio.config.Configfor integration.Refactored energy SUT for better clarification between clean and load.
Bugfixes for coal-related activities.
Updated correspondence from EXIO3 code.
Other readability update.
Backward Incompatible Changes
Deprecated
merge_emissions_accountin favor ofmerge_all_emissions.Removed
DEBUGconfiguration.Removed
clean_locattribute ofConfig.
Version 0.23.0#
Enhancements
New UI for documentation.
Refactored the algorithm for final demand footprint/contribution to calculate per capita footprint/contribution.
Integrated the first Parametrized production function.
Other documentation and code update.
Version 0.22.1#
Enhancements
Enhanced the inverse algorithm for cupy-based inversion.
Bugfix for reference/by- product list.
Switched from
numpytoscipy.sparsefor the default matrix inverse algorithm.Tested compatibility of critical tasks with Python3.12.
Refactored
generate_fd_simaprotask and renamed it togenerate_fd_b2.
Version 0.22.0#
Enhancements
Refactored the algorithm for creating the Stone’s market.
Refactored the algorithm for squarizing the supply and use table.
Enhanced the algorithm for calculating footprint.
Enahced the algorithm for creating the b2 Version for HIOT.
Backward Incompatible Changes
Adjusted workflow and deprecated few tasks.
Version 0.21.0#
Enhancements
Refactored the routine for FAOSTAT data processing
Converted BigClimate data into LCI data format
Added USGS data cleaning
Enhanced algorithm for balancing.
Bugfix for Stone’s market.
Added
classificationspackage dependency.Documentation update.
Version 0.20.0#
Enhancements
Fixed sourcing of new version file when not available.
Refactored to use reference product for constraints in co-production.
Added
resource_repositorytoConfig.Added task to extract energy efficiencies.
Enhanced the balance algorithm.
Fixed property update for nodes in graph.
Added
rdflibas a dependency.Added RDF graph implementation to
SUTGraph.Refactored task
create_stone_market.
Backward Incompatible Changes
Deprecated
task_statusinTask.runmethod.
Version 0.19.0#
Enhancements
Compatibility update for the
WorkflowandTaskclass.Bugfix for
allocate_FAO_feedandadd_by_products_to_market_feed.Disaggregated several activities to fix by-production.
Removed unused scripts.
Improved documentation on integration of parametrized production function.
Added notebook to do country emission comparison.
Version 0.18.6#
Enhancements
Enhanced balance algorithm.
Added task dependency and its network visualization function in task class.
Documentation update.
Version 0.18.5#
Enhancements
Enhanced balance algorithm.
Upgraded
ipoptsolver from3.11to3.14.Bugfix for task registration.
Documentation update.
Version 0.18.4#
Enhancements
Fixed
clean_fao_products_transfer_product_coeff.Associated versions with configuration date.
Moved version directory to
BONSAI_HOME.Improved documentation on integration of parametrized production function.
Refactored tasks reltaed to the emission account.
Added
calculate_output_proportionality_coefftask to estimate by-production proportion.Other documentation update.
Version 0.18.3#
Enhancements
Excluded
C_MOTOandC_OTREfrom balance.Fixed cyclic task dependency among prices, hybrid SUT, and transport. #365
Fixed correspondence issue with
distribute_agri_products_used_as_seed. #364Fixed an issue with
replace_activities_with_markets.Added deprecation warnings for some utility functions.
Other code and documentation update.
Backward Incompatible Changes
Deprecated
creates_initial_use_accounts.Removed
exiogen_data_for_distrib_coeffs.py.
Version 0.18.2#
Enhancements
Bugfixs for tasks.
Removed global market in SUTs.
Added tonnes (service) as a property layer for waste treatment service.
Updated documentation on methodology and PPF integration
Bugfix for feed use estimate.
Adjusted gap-filling procedure for price.
Added waste stock estimate.
Version 0.18.1#
Enhancements
Updated
build_hybrid_sutto new workflow and other simplifications.Fixed an issue in monetary SUT build.
Updated
Task.infoand overideTask.__repr__to useTask.info.Other bugfix and code readability improvement.
Updated documentation.
Version 0.18.0#
Enhancements
Added task dependencies for all tasks.
Upgraded dependency on the transport module to use
Transport.distance.Used https connection to fetch the
transportpackage.Finalized the market account and created the first draft for supply and use table before balancing.
Added new algorithms to gapfill prices.
Added a version folder for the version file.
Refactored algorithms related to trade for readability.
Version 0.17.3#
Enhancements
Fixed the
aggregate_faostat_accountstask.Updated task sequence related to the B2 version.
Added
to_databaseattribute to theConfigclass.Fixed a correspondence error in
estimate_ferts_supply_n_property.Fixed a schema error in
calculate_ferts_markets.Added automatic identification of
task_namewith.get_dataframe_with_taskinCSVResourceRepository.Added the
collect_fao_exchange_ratetask.Fixed path error for
clean_exio_3.
Backward Incompatible Changes
Deprecated
log_levelandlog_handlerinstance attributes ofConfig.
Version 0.17.2#
Enhancements
Added
list_enginesmethod forMatrix.Added dependency for
scikit-learn.Fixed error in
clean_land_use.Bugfix and other documentation updates.
Backward Incompatible Changes
Deprecated
ut.report_taskin favor ofTask.log.Deprecated
auto_apifor documentation.
Version 0.17.1#
Enhancements
Added
parallelargument to allow parallelization of route searching.Added dependency to
rpy2for R scripts integration.Fixed an issue in freight market estimation.
Modified the method to derive freight rate and inventory cost.
Version 0.17.0#
Enhancements
Fixed wrong mapping in price estimation of market products.
Added
Routeto interact withtransportpackage.Added
FreightTranportwith logit Choice model to estimate transport modal share.Renamed
calc_freight_transport_usetocalc_freight_use.Added
merge_freight_use.Added package use and trade estimate.
Refactored market account estimation.
Version 0.16.2#
Enhancements
Fixed token setting with paginated results.
Uploaded forestry product correspondence to API.
Added passenger transport from OECD.
Added gapfill tasks for freight transport.
Cleaned UN production data.
Version 0.16.1#
Enhancements
Removed task related fuel use by transport due to duplication.
Added freight transport API fetch from OECD.
Estimated freight and passenger transport supply.
Deprecated few
PathBuilderinstance attributes.Added estimate of package supply.
Added estimate of treatment activity.
Other bug fixes.
Version 0.16.0#
Enhancements
Added dependency on the
transportpackage.Fixed token fetch error in
DataReader.Modified a validation check in mapping.
Added the transport account.
Fixed API request error with no-token access.
Version 0.15.1#
Enhancements
Added package and residual agricultural product use.
Added package waste supply and use.
Added example code for classification disaggregation.
Updated documentation.
Version 0.15.0#
Enhancements
Added
token_useconfiguration to avoid duplicated token-use prompt. #322Moved token setting related methods from
ConnectortoConnectorFactory.Created a
SingletonMetaclass forConfigto avoid duplicated initiation of configuration.Removed rough code from
src/.
Version 0.14.3#
Enhancements
Splitted monetary SUT data into distinct accounts.
Improved use of classifications.
Removed unused task related to monetary distribution coefficients.
Removed
trade_routemodule.Added
transportmodule.
Version 0.14.2#
Enhancements
Fixed bugs related to
PathBuilder.Added tasks to estimate package use and package waste.
Added task to aggregate BONSAI back to EXIOBASE.
Backward Incompatible Changes
Deprecated few path attributes of
PathBuilder.
Version 0.14.1#
Enhancements
Automated env var
BONSAI_TOKENsetting through user input. #318Added token caching.
Added token creating API endpoint into
APIEndpointenum.Deleted deps on
frictionless.Fixed
Task.runby giving default parameters.Fixed several path instances.
Version 0.14.0#
Enhancements
Separated
import_MSUTs_n_generates_distr_coeffsintoclean_monetary_supplyandclean_monetary_use_n_fd.Modified the behavior of
PathBuilder.composeso thataccount_nameis no longer mandatory.Added a task to convert BONSAI classification to EXIOBASE classification.
Added OS platform specific marker for
pypardiso.Added
cupyas an optional engine for matrix inverse.Added the
Matrixclass.Set Python image as 3.11 in CI pipeline.
Version 0.13.1#
Enhancements
Replaced several correspondence files with correspondence API.
Added draft code to automatically disaggregate package classification.
Version 0.13.0#
Enhancements
Started to use APIs for classifications update.
Started to use APIs for correspondence mapping.
Created an example of interacting with APIs.
Added a new API endpoint for property values.
Fixed
collect_trade_matrixwith parquet file streaming.Created a
validatemodule to aggregate all the data validation utilities.
Backward Incompatible Changes
Deprecated
DataPackagein favor ofResource.
Version 0.12.6#
Enhancements
Code readability update.
Documentation update.
Version 0.12.5#
Enhancements
Modified the schema of the product property account.
Replaced csv-based location correspondence with the location correspondence API.
Added
putmethod forConnectorto update records in APIs.Replaced csv-based activity classification with the activity classification API.
Replaced csv-based product unit classifiction with the product classification API.
Updated documentation.
Backward Incompatible Changes
Deprecated
exio_unitin favor ofPropertyEnum.Depreacted the use of
unit_for_residual_products.xlsx.
Version 0.12.4#
Enhancements
Fixed errors in the estimation of global market supply and use.
Created a merged product property account.
Excluded the item count layer from balance.
Added energy content estimation for market products. #312
Added fertilizer LCI and nitrogen aborption estimation.
Version 0.12.3#
Enhancements
Fixed task dependencies of
balance_sut.Added ore, fuel, and extraction and CO2 absorption into the balancing model.
Added energy layer into the balancing model.
Rename
property_of_productstomerge_property_of_products.Added resource heat values and calculated energy supplies of resources.
Added the squared difference method for objective function setting.
Backward Incompatible Changes
Deprecated
IndexNames.RESOURCE_NAMEin favor ofIndexNames.RESOURCE.
Version 0.12.2#
Enhancements
Renamed
build_sut_for_balancingtobuild_hybrid_sut.Added
convert_sut_to_graphas a seperate task.Added
build_monetary_sutas a task to create supply and use tables in monetary units.Added price-derived monetary supply and use table in the balance model.
Added resource extensions to the balance. #302
Other code readability improvement.
Version 0.12.1#
Enhancements
Added emission flows into graph structure.
Added emission flows into balancing.
Fixed a duplication error in adding
.inflowsand.outflowstoNode.Added
calc_prices_market_productsandestimate_prices_other_productsto fill missing price information.
Version 0.12.0#
Enhancements
Refactored the
build_sut_for_balancingtask.Fixed the
merge_emission_accountstask.Improved the performance of
validate_graph_balancemethod ofSUTGraph.Used graph as the data structure required by the balance model.
Used uuid for node indexing to avoid index collision.
Used
PathBuilder.composefor balance files.
Version 0.11.5#
Enhancements
Fixed the
create_one_supplytask.Fixed an unit conversion error in waste treatment price. #292
Fixed double units for
M_eggslandM_eggplfor the supply table. #293Fixed an error in reading the correspondence of waste market to waste fraction.
Added
C_CHARinother_prod_v3_vs_v4.csvcorrespondence to fix a correspondence error in distrubuting product use.Fixed a correspondence error that causes missing fertilizer supply from China. #299
Backward Incompatible Changes
Deprecated
PathBuilder.baci_clean.
Version 0.11.4#
Enhancements
Added balance constraints for activities
Splitted out each layer for balance validation in the
validate_node_balancemethod.Renamed the
determine_heat_markets_cons_electask toseparate_heat_n_elec_consumption.Added task dependencies for the energy module and the LCI module.
Fixed the
clean_IEA_datatask.
Backward Incompatible Changes
Deprecated
PathBuilder.iea_source_data.
Version 0.11.3#
Enhancements
Added methodology documentation for by-product modelling, marginal electricity mix and capital endogenization.
Added related tasks to methodology sections.
Removed duplicated tasks in task registry.
Version 0.11.2#
Enhancements
Introduced property layer in the balance problem formulation.
Added tasks for packaging coefficient clean, and packing waste calculation.
Renamed
clean_eurostat_wastetoclean_eurostat_waste_treatment.Added tasks to disaggregate residential waste into industrial waste and municipality waste.
Added
export_graphmethod toBalanceModel.Added constraints for activity balance but not used because of not able to find an optimum.
Backward Incompatible Changes
Deprecated
export_resultsmethod ofBalanceModel.
Version 0.11.1#
Enhancements
Added
validate_balanceto theSUTGraphclass for graph-level balance validation.Renamed node-level balance from
validate_balancetovalidate_balance_node.Fixed missing supply in balancing procedure.
Refactored
validate_balancemethod to validate balance on multiple properties layers.
Backward Incompatible Changes
Deprecated the
validate_graph_balanceutility function.Deprecated the
balance_nodemethod inSUTGraph.
Version 0.11.0#
Enhancements
Added the first working balance model.
Added closest match suggestion for
Workflow.get_task.Finished product balance model and consolidated the workflow for balance.
Added a script to analysze balance results.
Version 0.10.5#
Enhancements
Added gitlab url for documentations.
Fixed documentation errors and warnings from
sphinx.Added contribution guideline for
Documentation.Added favicon for the docs.
Refactored product supply and use balance validation and optimization.
Version 0.10.4#
Enhancements
Added BONSAI color scheme for documentation website
Version 0.10.3#
Enhancements
Added documentation on land use accounting.
Added CI pipeline for automatic documentation creating. #278
Added
__version__.pyto fix version in documentation.Switched to
autoapifor automatic API documentation.Fixed cross reference errors in readme.
Version 0.10.2#
Enhancements
Added
.logmethod in theTaskclass.Started to deprecate
report_taskfunction.Removed the use of
ut.report_taskandut.write_a_report.Added task dependencies for packaging related tasks.
Improved docstring for
PathBuilder.compose.
Version 0.10.1#
Enhancements
Modified the triggering conditions of tasks related to basic price footprint calculation.
Cleaned up hiot code related to footprint hybrid and footprint basic price.
Moved LCI clean data into clean directory and modified the
paths.lci_cleanedattribute of Paths.Moved account list into a persistent storage instead of in the repository to facilitate concurrent writing.
Added task dependency for food waste related tasks.
Version 0.10.0#
Enhancements
Cleaned up code related to HIOT manipulation.
Added deprecation warning to the
exio_unitclass.Added
generate_tidy_iointo the workflow.Miscenaneous code refactoring and documentation update.
Added Packaging account and tasks related to calculating package coefficients, and waste from packages.
Added human metabolism coefficient to calculate waste coefficient from final consumption.
Added a task determine_total_waste_of_products to aggregate waste supply account.
Added stock degradation function (waste lifetime).
Disaggregated waste into industrial waste and municipality waste.
Backward Incompatible Changes
Depreacted the
create_compact_iotask.Renamed
calc_hiot_n_footprinttocalc_footprint_b1.Renamed
utility_exiobase_3.pytoutil_others.py.
Version 0.9.3#
Enhancements
Introduced
pypardisoto solve A matrix inversion.Full matrix inversion for b1, iLUC, marginal electricity and capital endogenization version using
pypardiso.Improved the algorithm for updating HIOT with marginal electricity mix data.
Version 0.9.2#
Enhancements
Created a unified table for transfer coefficients.
Created a unified table for waste coefficients.
Created a unified table for emission coefficients.
Fixed an unit issue in capital endogenization.
Bugfix with the
import_lci_alcolic_beveragetask.Added byproduction of beverage into the Supply table.
Add byproduction of feed into the feed market.
Fixed an unit issue with the
clean_fao_forestrytask.Added
PropertyEnumto standardize the use of units across the repository.Downgraded account not found infomation in
VersionCollectionfromwarningtoinfo.Added direct activation of tasks within the
DEBUGmode.Upgraded
faostatapi to v1.1.1 because the service URL has changed.Added a first version of tidy IO implementation. (Not included in the workflow yet).
Backward Incompatible Changes
Moved default settings to the first level of support.
Renamed
config_data.pyasconfig.py. TheConfigclass will be used for configuration loading in the future.Replaced
exio_unitwithPropertyEnum.
Version 0.9.1#
Enhancements
Refactored waste price estimation and added into task registration.
Refactored electricity price estimation and added into task registration.
Added task dependencies for price related tasks.
Started to deprecate data packages.
Integrated BACI data collection into the workflow.
Other documentation updates.
Backward Incompatible Changes
Deprecated
lci_monet_genericattribute forPathBuilderbecuase it is same aslci_prod_generic.Modified the default behavoir of the
PathBuilder.compose. Now it defaults to get the latest version of an account (Before it isNone). To set a no-version path,version_datehas to be set asNoneexplicitly.
Version 0.9.0 (Renaming to BONSAI-IO)#
Version 0.8.3#
Enhancements
Bugfix for the
import_n_clean_IEA_datatask. #289Performance improvement for the
import_n_clean_IEA_datatask.Bugfix for the
import_n_convert_un_datatask.Consolidated workflow related to UN data.
Added a task
clean_prices_recyclingthat derives prices for product recycling. #290Added a task
clean_elec_pricesthat derives electricity prices from ComTrade.Added reference product to energy-related transfer coeffients. #291
Bugfix in the generate_market_of_heat task.
Bugfix for the clean_fao_forestry task.
Added a task calculate_by_production_of_beverage to calculate by-production of beverage and inserted into workflow.
Known issues
Missing activity correspondence between IEA and Base classifications causing error in the
clean_IEA_datatask.
Version 0.8.2#
Enhancements
Fixed a bug in testing zeros in the diagonal of
hiot_b2_extend.pkl. #285Converted supply use tables into a graph and do a node balance.
Fixed an issue in the
import_n_clean_IEA_datatask.
Version 0.8.1#
Enhancements
Fixed bugs related to unit and column name changes when integrating with FAOSTAT API with iLUC model.
Improved FAO clean task to accommodate multiple years.
Fixed a bug related to
PathBuilder.compose. Account source and version source not synchromized when an account is first created.Fixed bug for the
calc_tier1_contribtask and improved performance.Added the
aggr_tier1_contribtask to aggregate top contributions and post to the database.Added
chunk_sizeto thepostmethod ofConnectorfor lightweighted post.
Version 0.8.0#
Enhancements
Improved memory usage for the
generate_hiot_simaprotask.Fixed a bug in
PathBuilder.compose.Added
is_downstream_taskmethod for theTaskclass.Added the
stoparugment forWorkflow.execute.Fixed the
collect_trade_matrixtask for FAOSTAT.
Backward Incompatible Changes
Renamed the
start_fromargument of theWorkflow.executemethod tostart.Deprecated
Config.exnames.
Version 0.7.2#
Added
collect_comtrade_tradetask. (Known issue: quota exceeding error)Added
concat_footprintandcalc_tier1_contribinto the workflow.Fixed a bug in
PathBuilder.compose.Refactored the contribution analysis for speed.
Improved ReadMe document.
Version 0.7.1#
Renamed
determine_total_demand_of_manuretoclean_concito_manure_total.Added sorting for listed groups and tasks in
Workflow().list_tasks().Added
clean_baci_priceinto the workflow.Added
collect_baciandcollect_baci_unziptasks. (Still not working with clean tasks)Added scripts related to PV life cycle inventories.
Fixed bug in fertiliser market availability.
Version 0.7.0#
Fixed a bug in the
combine_trade_flowtask after integrating withfaostatAPI.Refactored distribution of monetary flows from exio3 into the use table.
Fixed a bug in merging LCI.
Moved calculation of available physical flow from final use table to inital use table.
Fixed a bug in generating FAOSTAT clean accounts that generate unintended
nanvalues.Refactored food distribution for the use table.
Refactored seed distribution for the use table.
Added extensions (Natural resource and value added) to the SimaPro version.
Refactored marginal electricity market insertion logic for SimaPro
Added
AccountandAccountRepositoryclasses for accounts data access.Added
VersionRepositoryinterface andTXTVersionRepositoryandAPIVersionRepositoryclass to manage version data access logic.Refactored
PathBuilder().createmethod to.composeso that it can compose a path with a given pattern ->/<stage>/<account>/<version_date>/Added a test for
Workflowinit.
Version 0.6.0#
Fixed a bug in url parse in the
Resourceclass.Fixed a bug in the
clean_fao_forestrytask.Added dependency to the
faostatpackage.Added
colleact_faostatrelated tasks.
Version 0.5.5#
Renamed
import_baci_for_exiobasetoclean_baci_trade.Added
clean_baci_w_trade.pyin thetrademodule to bridge the gap between collect and clean BACI data.Added the
aggregate_bacitask into task graph.Used
schema_enumsfor thecombine_trade_flowstask.Added waste and production related tasks into the task graph.
Added test for hiot market balance.
Version 0.5.4#
Upgraded dependecy to
Pandasfrom2.0.0to2.0.3to resolve redundant warnings.Renamed
elaborate_faostattask toaggregate_faostat_accountsand added upstream task dependencies for it.Renamed
fao_foresty_datatoclean_fao_forestryand added task dependencies for it.Improved the speed of the
clean_fao_fisherytask.Miscellaneous code refactor for readability improvement.
Version 0.5.3#
Fixed a location parse error in
Resource.Modularized the construction of use table for easier decomposition.
Added
clean_AU_waste,clean_eurostat_wasteandclean_waste_exio3tasks.
Version 0.5.2#
Fixed a
FileNotFoundbug in taskelaborate_faostat.Fixed a bug in task
land_use_extensions.Fixed a query error bug in
ResourceRepository.get_from_dataframemethod.Fixed an error in FAOSTAT country correspondence in task
elaborate_faostat.
Version 0.5.1#
Added
.upstream_tasksand.downstream_tasksmethod in theTaskclass to create task dependency.Added
TaskStatusto track the status of tasks in workflow.Workflow().execute()works now.Added tasks dependencies in task registration.
Added task
.is_ready()check to check the status of a task.BONSAI_HOMEcan now be set as/path/to/bonsai/_bonsai/as well.Updated ReadMe docs.
Version 0.5.0#
Added
ResourceandResourceRepositoryclasses for data resource management.Added
CSVResourceRepositoryandSQLiteResourceRepositoryfor different implementations of a resource repository.Added
.resource_repositoryproperty forConfig.Deprecated
._set_bonsai_rootmethod in PathBuilder. Now the environmental variableBONSAI_HOMEis the only way to initiate the workflow.Improved performance for the
clean_sua_crop_livestask.Fixed bugs in the
trade_routemodule.Updated docs on data access and quick examples.
Version 0.4.3#
Added
distribute_IEA_final_consumption_to_activitiestask to allocate energy across final consumption activities.Optimized sparse data representation to decrease the size of exported datasets.
Fixed mapping of IEA heat markets and base activities classification.
Fixed an issue in MSUT unit labelling, changing from “euro” to “Meuro”.
Miscellaneous bug fix and docs update.
Version 0.4.2#
Deprecated
exnamesin favor ofschema_enums.Register all tasks in
workflow_main.pyto task_registry.Improved documentation for
Task.Added
.run_tasks()method to run several tasks.Renamed the
workflow_mainmodule totask_registrationUpdated documentation on setting up environmental variable.
Wrapped up all tasks into task_registry.
Version 0.4.1#
Updated dependence to
pandas==2.0and related code refactoring.Fixed bugs in clean FAOSTAT data.
Deprecated
paths_exioproperty forConfig.Added deprecation warning to
exnamesproperty.Added
schema_enumsproperty to replaceexnamesin theConfigclass.Added format for
Workflow.list_tasks()method for better usability.Fixed a bug in ferlizer cleaning.
Added
.get_task_info()method for theWorkflowclass.
Version 0.4.0#
Finished first version of the
Workflowclass and theTaskclass.Created a new way to register tasks to workflow.
Added templates for contributing.
Other bug fixs and documentation update.
Bumped BONSAI version to
1.1.0
Version 0.3.3#
Fixed path error to
b2_simapro_version.Miscellaneous code clean up.
Version 0.3.2#
Inserted revised LCI data for fertilisers
Removed unexpected input of fertilisers into energy/electricity processes
Corrected null margins for outputs from multi-functional activities
Renamed the
exio_namesmodule asschema_enumsand decoupled from tasksAdded a database level versioning variable
DB_VERSION
Version 0.3.1#
Added
.list_path_attributesmethod toPathBuilder.Cleaned up utilities from exiobase3.
Updated documentation on installation and quick start in
Readme.md.Renames
capital_invest_mat_rev2.pyascapital_invest_mat.py.Added a logging utility:
deprecateddecorator.Added deprecation warning to
Config.paths_exio, ready to replace.paths_exiowith.path_repository.Moved
report_change_in_versionsfunction tologgings.pyfor better logging management.Created
methodology.mdand moved detailed methodology descriptions.
Version 0.3.0#
The
ExioPathsclass is renamed asPathBuilderfor generalization of naming.._path_exioproperty of theConfigclass is renamed as_path.version_fileargument is deprecated in thePathManagerclass..list_parameters()method is added for theConfigclass for better exploration of the configuration by users.Added
taskdecorator to register tasks to a global register for workflow to find.Added
list_tasksanddiscover_tasksto theWorkflowclass.Incorporated path creating logic into
PathBuilder.
Version 0.2.1#
Added a task to aggregate footprint in different units.
Version 0.2.0#
This release introduces significant architectural improvements to the project, focusing on enhancing the workflow execution and configuration management. Key developments include the introduction of a Workflow class for streamlined workflow management and a Config class for centralized configuration handling.
Created
Workflowclass to to orchestrate the execution of tasks, making the workflow process more intuitive and manageable.Restructured the project hierarchy, moving
ConfigandWorkflowclasses to the first level of import for easier access and better modularity.Other bug fixes.
Version 0.1.0#
Packaged the code for the generation of exiobase 2016 tables.
bonsai-export#
Version 0.4.3 (upcoming)#
Version 0.4.2#
Bug fixes
Preserve square meter-year occupation flows in SimaPro exports with the
m2aunit.
Version 0.4.1#
Bug fixes
CI release job builds only the wheel, like
bonsai-io. The source distribution cannot include../../src, so building from it failed for everybonsai-exporttag since 0.1.0.
Version 0.4.0#
Backward Incompatible Changes
Removed the custom SimaPro process export (
CustomProcessConfig,SimaProConverter.convert_custom_json_to_file); it is project-specific and now lives in the 2-0 LCAbw20lca_toolspackage (bw20lca_tools.bonsai_simapro).SimaProConverterbuilding blocks are public, so external exporters can compose them:write_header,get_simapro_name,build_avoided_productsandbuild_elementary_flows(previously underscore-prefixed).Brightway: elementary flows without a unit no longer get
tonneby default.
Enhancements
Declared the runtime dependencies (
numpy,pandas,tqdm) sobonsai-exportinstalls on its own, withoutbonsai-io.
Bug fixes
SimaPro: write natural resources to the
Resourcessection of each process instead of the invalidRaw materials/Not foundsections, which SimaPro does not import.SimaPro: map
cubic meter,standard cubic meterand landmeter ** 2(occupation,m2a) units, so water, gas and land flows are no longer silently dropped.SimaPro: fall back to name matching when an elementary flow’s ecoinvent
source_idis missing from the SimaPro 9.4 mapping file, and add verified SimaPro 9.4 names for NMVOC, cooling water, natural gas, bromine, iodine, standing wood, silica (Sand, quartz) and sodium chloride.SimaPro: use each substance’s reported unit for terminated-activity emissions instead of assuming tonnes, without overwriting the terminated activity’s own reference unit (products such as land transport services were exported in
toninstead ofMEUR2016, inconsistent withmarkets.csv).SimaPro: export monetary units as
MEUR2016instead ofMEUR2011.SimaPro: export
Waterelementary flows inton(SimaPro’sWatersubstance is mass-based; 1 m3 = 1 ton) instead ofm3.SimaPro: look up prices and property metadata (dry matter, calorific value, mass) by reference product code, so prices are exported again; the price is labelled in MEUR per reference unit.
SimaPro: map
KCAP_*capital codes to aCapitaldatabase.SimaPro: skip processes with a zero reference flow, and log dropped elementary flows and skipped processes instead of printing errors and continuing silently.
SimaPro: create the output directory, and write each file to a temporary path that is renamed only on success.
SimaPro: separate the levels of a process folder with
\, the separator SimaPro uses, instead of/.
Version 0.3.2#
Enhancements
Made SimaPro and Brightway export input models accept classification product, activity, and elementary-flow tables directly instead of through a dedicated classification aggregate.
Renamed the internal
BONSAIData.elementary_flows_frameattribute toelementary_flow_classificationso exporter code distinguishes classification metadata from runtime elementary-flow tables.Simplified SimaPro elementary-flow mapping internals by removing redundant resolver methods and keeping classification-driven UUID lookup as the single mapping path.
Version 0.3.1#
Enhancements
Renamed
BrightwayExportInputs.emissionstoBrightwayExportInputs.elementary_flows, keeping the Brightway export API aligned with the elementary-flow table consumed to build the biosphere matrix and metadata.
Version 0.3.0#
Enhancements
Replaced the SimaPro exporter’s hard-coded BONSAI flow lookup table with source-driven elementary-flow resolution from classification metadata plus
SimaProv94-ecoinventEFv3.7.csv, and aligned both direct and terminated emissions to the rawExio substanceruntime identifiers.Updated exporter release notes to reflect that emissions supplied from
bonsai-iomay already carry elementary-flow-resolved identifiers produced earlier in the workflow instead of being remapped only at footprint-writing time.Added elementary-flow classification passthrough on exporter input bundles so exporters can resolve internal BONSAI elementary-flow UUIDs back to the human-readable emission names expected by Brightway and SimaPro mapping tables.
Restored Brightway biosphere matrix construction for UUID-keyed emissions by resolving exporter-side elementary-flow identifiers before building the biosphere matrix.
Switched Brightway biosphere metadata construction from hard-coded flow definitions to elementary-flow source data, so names, units, and compartments are derived directly from the classification payload.
Removed exporter-side selected-emission filtering in the Brightway path so all available elementary flows in the BONSAI emissions input are exported.
Updated Brightway biosphere matrix and metadata keys to use the raw BONSAI elementary-flow identifiers from
Exio substanceinstead of cleaned flow names, while keeping source classification fields such assource_idin metadata for downstream ecoinvent alignment.
Version 0.2.1#
Enhancements
Removed
basic_to_purchaser_pricefromBONSAIDataand exporter metadata handling so exporter outputs no longer carry or report that ratio.
Backward Incompatible Changes
SimaProMetadataInputsno longer acceptsbasic_to_purchaser_price.Removed
ActivityData.pp.Exporter-generated process metadata now reports only the reference product price and no longer emits purchaser-price text derived from
basic_to_purchaser_price.Renamed
SimaProMetadataInputs.basic_pricestoSimaProMetadataInputs.pricesbecause the exporter now consumes the unified price dataset directly instead of a basic-price-specific input.
Version 0.2.0#
Enhancements
Refactored
BONSAIDatato initialize from explicit in-memory export inputs instead of inferring required datasets from filesystem paths or surrounding project state.Added import-specific typed input bundles for Brightway and SimaPro exports so each export mode declares its required BONSAI datasets up front.
Added fail-fast validation for missing required inputs, improving testability and making initialization errors explicit.
Moved path-based data loading out of the core exporter initialization path and into the
bonsai-ioexport task layer.Simplified
BONSAIDataso pass-through inputs such asfinal_demand_tableand normalizedbasic_pricesare stored as plain attributes instead of lazy cached accessors.Removed Brightway output-path handling from export input bundles; output location is now runtime converter/task configuration instead of BONSAI source data.
Backward Incompatible Changes
Replaced the path-driven
ExportContextinitializer inbonsai-exportwith explicit export input bundles for converter andBONSAIDatainitialization.SimaProMetadataInputs.basic_pricesnow expects the normalized lookup dict consumed by the exporter instead of a raw dataframe.
Version 0.1.0#
Enhancements
Split exporter into standalone package
packages/bonsai-export.Added package-specific versioning with tags
bonsai-export-vX.Y.Z.Added CI release job for exporter package builds/publish flow.
Replaced
bonsai-ioConfigcoupling with a typed export context contract for converters.
Backward Incompatible Changes
Exporter import path moved from
bonsai.io.exporttobonsai.export.Removed
bonsai.export.simapro.export_taskandbonsai.export.brightway.export_task; export task entrypoints now live inbonsai-io.