Skip to main content

carculator_bus

Prospective environmental and economic life cycle assessment of city buses and coaches, including depot, opportunity and in-motion charging.

Installed artifacts PyPI

Developed at the Paul Scherrer Institute. This checkout prepares 0.1.1; see CHANGELOG.md for release status and changes.

Installation

Use Python 3.12 (>=3.12,<3.13) and a fresh environment. The shared runtime requires NumPy >=1.26.4,<2.

python3.12 -m venv .venv
source .venv/bin/activate

On Windows, activate with .venv\Scripts\activate. After publication, install this release from PyPI:

python -m pip install "carculator_bus==0.1.1"

Before publication, use the matching source checkouts as described under development. Core calculations use bundled resources and need no Brightway project, ecoinvent installation or network access. Inventory export has optional dependencies:

python -m pip install "carculator_bus[excel,brightway]==0.1.1"

The Brightway extra supports the legacy stack (bw2io<0.9, bw2data<4, bw2calc<2). Export currently targets ecoinvent 3.9 and 3.10; importing those inventories requires the corresponding background database in the destination tool.

Quick start

from carculator_bus import (
    BusInputParameters,
    BusModel,
    InventoryBus,
    fill_xarray_from_input_parameters,
)

inputs = BusInputParameters()
inputs.static()
_, array = fill_xarray_from_input_parameters(
    inputs,
    scope={"size": ["13m-city"], "powertrain": ["ICEV-d", "BEV-depot"], "year": [2025]},
)
model = BusModel(array)
model.set_all()
print(model["TtW energy"])  # kJ per vehicle-kilometre

inventory = InventoryBus(model, functional_unit="pkm")
impacts = inventory.calculate_impacts()
print(impacts.sel(impact_category="climate change").sum("impact"))

Bus model cost outputs are already per passenger-kilometre; inventory normalization is a separate choice.

Modelling and validation

The vehicle models include native 2025 parameters and documented temporal extensions. These combine engineering priors and selected calibration evidence; they are not independent measurements for every vehicle configuration.

TtW energy is in kJ/km. For BEVs it is net stored-energy depletion; model.battery_terminal_energy reports terminal DC separately, while electricity consumption is grid electricity in kWh/km. Identify the measurement boundary before comparing energy outputs. Availability-masked zeroes do not represent physically zero consumption.

Supported background scenarios are SSP2-NPi, SSP2-PkBudg1000, SSP2-PkBudg650, and static. ReCiPe supports midpoint/endpoint and EF midpoint. Use fresh model instances for independent cases. inputs.stochastic(n, seed=...) seeds parameter sampling, not every downstream cost adjustment.

See validation and limitations, migration notes and the documentation.

Development and release

Use matching sibling checkouts, especially carculator_utils 1.3.6 or newer:

python -m pip install -e "../carculator_utils[test,excel,brightway]" -e ".[test,docs,excel,brightway]"
python -m pip check
python -m pytest
python -m sphinx -b html docs docs/_build/html

The docs extra includes the extensions used by this repository. See RELEASING.md for artifact verification, release order and publication.

Support and license

Contact carculator@psi.ch or open an issue. Maintained by Romain Sacchi, with contributions from the carculator development team. See contributing. Licensed under BSD-3-Clause.

Metadata

Release files for carculator-bus 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for carculator-bus 0.1.1
File Size Uploaded
carculator_bus-0.1.1.tar.gz 691.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for carculator-bus 0.1.1
File Interpreter ABI Platform
carculator_bus-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 796.2 kB

Release files / carculator_bus-0.1.1.tar.gz

Download URL carculator_bus-0.1.1.tar.gz
Size 691.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fdd603f6b25227850713e2c1bacc97dee13b0443a202c1ed1720576cdf65b2e3
BLAKE2b-256 checksum
How to use checksums
6d71ba377bdb72c62068d027b0ac43647aa7a0ee6694856e3fed1057041c4fe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / carculator_bus-0.1.1-py3-none-any.whl

Download URL carculator_bus-0.1.1-py3-none-any.whl
Size 104.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ade7aa00e47f52161288771a24c04b1ae51ac816487c8ade94804b6138bf3fd
BLAKE2b-256 checksum
How to use checksums
62aa92108397cfd01d6beccc33c826b91a6d8daa44cc8c91234a2a30f5f59575
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page