nrel.routee.powertrain


Namenrel.routee.powertrain JSON
Version 1.2.1 PyPI version JSON
download
home_pageNone
SummaryRouteE-Powertrain is a tool for predicting energy usage over a set of road links.
upload_time2025-01-29 21:41:33
maintainerNone
docs_urlNone
authorNational Renewable Energy Laboratory
requires_python>=3.9
licenseBSD 3-Clause License Copyright (c) 2023, Alliance for Sustainable Energy, LLC
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # <img src="docs/images/routeelogo.png" alt="Routee Powertrain" width="100"/>

<div align="left">
    <img src="https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-blue"/>
  <a href="https://pypi.org/project/nrel.routee.powertrain/">
    <img src="https://img.shields.io/pypi/v/nrel.routee.powertrain" alt="PyPi Latest Release"/>
  </a>
</div>

## Overview

RouteE-Powertrain is a Python package that allows users to work with a set of pre-trained mesoscopic vehicle energy prediction models for a varity of vehicle types. Additionally, users can train their own models if "ground truth" energy consumption and driving data are available. RouteE-Powertrain models predict vehicle energy consumption over links in a road network, so the features considered for prediction often include traffic speeds, road grade, turns, etc.

The typical user will utilize RouteE's catalog of pre-trained models. Currently, the
catalog consists of light-duty vehicle models, including conventional gasoline, diesel,
hybrid electric (HEV), plugin hybrid electric (PHEV) and battery electric (BEV). These models can be applied to link-level driving data (in the form
of [pandas](https://pandas.pydata.org/) dataframes) to output energy consumption predictions.

Users that wish to train new RouteE models can do so. The model training function of RouteE enables users to use their
own drive-cycle data, powertrain modeling system, and road network data to train custom models.

## Quickstart

RouteE Powertrain is available on PyPI and can be installed with `pip`:

```bash
pip install pip --upgrade
pip install nrel.routee.powertrain
```

If `pip` is unavailable, use `pip3`:
```bash
pip3 install pip --upgrade
pip3 install nrel.routee.powertrain
```

(For more detailed instructions, see [here](https://nrel.github.io/routee-powertrain/installation.html))

Then, you can import the package and use a pre-trained model from the RouteE model catalog:

```python
import pandas as pd
import nrel.routee.powertrain as pt

# Print the available pre-trained models
print(pt.list_available_models(local=True, external=True))

# [
#   '2016_TOYOTA_Camry_4cyl_2WD',
#   '2017_CHEVROLET_Bolt',
#   '2012_Ford_Focus',
#   ...
# ]

# Load a pre-trained model
model = pt.load_model("2016_TOYOTA_Camry_4cyl_2WD")

# Inspect the model to see what it expects for input
print(model)

# ========================================
# Model Summary
# --------------------
# Vehicle description: 2016_TOYOTA_Camry_4cyl_2WD
# Powertrain type: ICE
# Number of estimators: 2
# ========================================
# Estimator Summary
# --------------------
# Feature: speed_mph (mph)
# Distance: miles (miles)
# Target: gge (gallons_gasoline)
# Raw Predicted Consumption: 29.856 (miles/gallons_gasoline)
# Real World Predicted Consumption: 25.606 (miles/gallons_gasoline)
# ========================================
# Estimator Summary
# --------------------
# Feature: speed_mph (mph)
# Feature: grade_dec (decimal)
# Distance: miles (miles)
# Target: gge (gallons_gasoline)
# Raw Predicted Consumption: 29.845 (miles/gallons_gasoline)
# Real World Predicted Consumption: 25.596 (miles/gallons_gasoline)
# ========================================

# Predict energy consumption for a set of road links
links_df = pd.DataFrame(
    {
        "distance": [0.1, 0.2, 0.3], # miles
        "speed_mph": [30, 40, 50], # mph
        "grade_percent": [-0.5, 0, 0.5], # percent
    }
)

energy_result = model.predict(links_df)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nrel.routee.powertrain",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "National Renewable Energy Laboratory",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/bb/13/fe65deaa4a865b4c2e2810ff5aa7c1e023bf9e7c23f011e19a1e4e58146b/nrel_routee_powertrain-1.2.1.tar.gz",
    "platform": null,
    "description": "# <img src=\"docs/images/routeelogo.png\" alt=\"Routee Powertrain\" width=\"100\"/>\n\n<div align=\"left\">\n    <img src=\"https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-blue\"/>\n  <a href=\"https://pypi.org/project/nrel.routee.powertrain/\">\n    <img src=\"https://img.shields.io/pypi/v/nrel.routee.powertrain\" alt=\"PyPi Latest Release\"/>\n  </a>\n</div>\n\n## Overview\n\nRouteE-Powertrain is a Python package that allows users to work with a set of pre-trained mesoscopic vehicle energy prediction models for a varity of vehicle types. Additionally, users can train their own models if \"ground truth\" energy consumption and driving data are available. RouteE-Powertrain models predict vehicle energy consumption over links in a road network, so the features considered for prediction often include traffic speeds, road grade, turns, etc.\n\nThe typical user will utilize RouteE's catalog of pre-trained models. Currently, the\ncatalog consists of light-duty vehicle models, including conventional gasoline, diesel,\nhybrid electric (HEV), plugin hybrid electric (PHEV) and battery electric (BEV). These models can be applied to link-level driving data (in the form\nof [pandas](https://pandas.pydata.org/) dataframes) to output energy consumption predictions.\n\nUsers that wish to train new RouteE models can do so. The model training function of RouteE enables users to use their\nown drive-cycle data, powertrain modeling system, and road network data to train custom models.\n\n## Quickstart\n\nRouteE Powertrain is available on PyPI and can be installed with `pip`:\n\n```bash\npip install pip --upgrade\npip install nrel.routee.powertrain\n```\n\nIf `pip` is unavailable, use `pip3`:\n```bash\npip3 install pip --upgrade\npip3 install nrel.routee.powertrain\n```\n\n(For more detailed instructions, see [here](https://nrel.github.io/routee-powertrain/installation.html))\n\nThen, you can import the package and use a pre-trained model from the RouteE model catalog:\n\n```python\nimport pandas as pd\nimport nrel.routee.powertrain as pt\n\n# Print the available pre-trained models\nprint(pt.list_available_models(local=True, external=True))\n\n# [\n#   '2016_TOYOTA_Camry_4cyl_2WD',\n#   '2017_CHEVROLET_Bolt',\n#   '2012_Ford_Focus',\n#   ...\n# ]\n\n# Load a pre-trained model\nmodel = pt.load_model(\"2016_TOYOTA_Camry_4cyl_2WD\")\n\n# Inspect the model to see what it expects for input\nprint(model)\n\n# ========================================\n# Model Summary\n# --------------------\n# Vehicle description: 2016_TOYOTA_Camry_4cyl_2WD\n# Powertrain type: ICE\n# Number of estimators: 2\n# ========================================\n# Estimator Summary\n# --------------------\n# Feature: speed_mph (mph)\n# Distance: miles (miles)\n# Target: gge (gallons_gasoline)\n# Raw Predicted Consumption: 29.856 (miles/gallons_gasoline)\n# Real World Predicted Consumption: 25.606 (miles/gallons_gasoline)\n# ========================================\n# Estimator Summary\n# --------------------\n# Feature: speed_mph (mph)\n# Feature: grade_dec (decimal)\n# Distance: miles (miles)\n# Target: gge (gallons_gasoline)\n# Raw Predicted Consumption: 29.845 (miles/gallons_gasoline)\n# Real World Predicted Consumption: 25.596 (miles/gallons_gasoline)\n# ========================================\n\n# Predict energy consumption for a set of road links\nlinks_df = pd.DataFrame(\n    {\n        \"distance\": [0.1, 0.2, 0.3], # miles\n        \"speed_mph\": [30, 40, 50], # mph\n        \"grade_percent\": [-0.5, 0, 0.5], # percent\n    }\n)\n\nenergy_result = model.predict(links_df)\n```\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License Copyright (c) 2023, Alliance for Sustainable Energy, LLC",
    "summary": "RouteE-Powertrain is a tool for predicting energy usage over a set of road links.",
    "version": "1.2.1",
    "project_urls": {
        "Homepage": "https://github.com/NREL/routee-powertrain"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b4fc8ba044a9957eea542262b5e3a6d11e3fb0037d7ee89a8a95beb45f5c4449",
                "md5": "2334de9503e338fb9d907b129d7ca19c",
                "sha256": "9f868ed3b8417fe544965881b12dd71d647835792e174714747e9664c7d2374e"
            },
            "downloads": -1,
            "filename": "nrel_routee_powertrain-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2334de9503e338fb9d907b129d7ca19c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 1963161,
            "upload_time": "2025-01-29T21:41:31",
            "upload_time_iso_8601": "2025-01-29T21:41:31.255600Z",
            "url": "https://files.pythonhosted.org/packages/b4/fc/8ba044a9957eea542262b5e3a6d11e3fb0037d7ee89a8a95beb45f5c4449/nrel_routee_powertrain-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "bb13fe65deaa4a865b4c2e2810ff5aa7c1e023bf9e7c23f011e19a1e4e58146b",
                "md5": "6fb50af7a56602e41f0f06a4dc6e3838",
                "sha256": "17d4313530088d7164f6417332a761a7816663f0156eb81a49c3f1a0c109888f"
            },
            "downloads": -1,
            "filename": "nrel_routee_powertrain-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6fb50af7a56602e41f0f06a4dc6e3838",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 1930239,
            "upload_time": "2025-01-29T21:41:33",
            "upload_time_iso_8601": "2025-01-29T21:41:33.838697Z",
            "url": "https://files.pythonhosted.org/packages/bb/13/fe65deaa4a865b4c2e2810ff5aa7c1e023bf9e7c23f011e19a1e4e58146b/nrel_routee_powertrain-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-29 21:41:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NREL",
    "github_project": "routee-powertrain",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nrel.routee.powertrain"
}
        
Elapsed time: 0.36819s