Metadata-Version: 2.3
Name: t3co
Version: 1.0.7
Summary: NREL's Transportation Technology Total Cost of Ownership tool
Project-URL: Homepage, https://www.nrel.gov/transportation/t3co.html
Project-URL: Documentation, https://nrel.github.io/T3CO
Project-URL: Repository, https://github.com/NREL/T3CO
Project-URL: Bug Tracker, https://github.com/NREL/T3CO/issues
Author-email: Harish Panneer Selvam <Harish.PanneerSelvam@nrel.gov>, Alicia Birky <Alicia.Birky@nrel.gov>, Chad Baker <Chad.Baker@nrel.gov>
Maintainer-email: NREL-AVCI <t3co@nrel.gov>
License: BSD 3-Clause License
        
        Copyright (c) 2024, Alliance for Sustainable Energy, LLC
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Keywords: tco,total-cost,total-cost-of-ownership,vehicle-cost,vehicle-simulation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Requires-Dist: fastsim==2.1.1
Requires-Dist: numpy==1.24.1
Requires-Dist: pandas==2.0.3
Requires-Dist: pymoo==0.6.1
Requires-Dist: scipy==1.10.1
Description-Content-Type: text/markdown

![T3CO Logo](docs/t3co_logo.svg)

[![homepage](https://img.shields.io/badge/homepage-t3co-blue)](https://www.nrel.gov/transportation/t3co.html) [![github](https://img.shields.io/badge/github-t3co-blue.svg)](https://github.com/NREL/T3CO) [![PyPI version](https://badge.fury.io/py/t3co.svg)](https://badge.fury.io/py/t3co) ![GitHub License](https://img.shields.io/github/license/NREL/T3CO) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/t3co) 


# **T3CO** : Transportation Technology Total Cost of Ownership Tool
## Description

This repo houses T3CO (Transportation Technology Total Cost of Ownership), software for modeling total cost of ownership for commercial vehicles with advanced powertrains.

To start, go to the [Overview](https://github.com/NREL/T3CO/blob/264a730de942671eb2345a5afca7e1afd6d67666/docs/T3CO_Overview.md)

## Usage

**T3CO** is a general framework allowing a user to determine the total cost of ownership (TCO) of a FASTSim vehicle (paired with a FASTSim DriveCycle(s) for determining fuel efficiency). The user can also determine performance of gradability, acceleration, and range. In addition to straight TCO computation there is also the option to optimize a vehicle powertrain such that it meets performance optional targets while also optionally minimizing TCO.

## Installation
**From PyPI**
```bash
pip install t3co
```

**From Github**

First, clone the repository from **NREL** GitHub:

    git clone https://github.com/NREL/T3CO.git T3CO

t3co depends on python 3.8. One way to satisfy this is to use conda:

    conda create -n t3co python=3.8
    conda activate t3co

After creating the environment, navigate to the parent directory containing the T3CO repository e.g. `cd github/T3CO/` and run:

    pip install -e .

from within the t3co python 3.8 environment you created.  

This will install t3co with minimal dependencies such that t3co files can be editable. Developers will find the `-e` option handy since t3co will be installed in place from the installation location, and any updates will be propagated each time t3co is freshly imported.  

to be compatible with the current code in T3CO.

## Demo
**Using the [T3CO Config](https://github.com/NREL/T3CO/blob/c3df6421033cef7d35b7d7cd575ab94e85fcd9a9/t3co/resources/T3COConfig.csv) file**

```bash
cd t3co
python sweep.py --analysis-id 0
```

**Or get some quick TCO results**

```bash
cd t3co
python sweep.py --skip_all_opt --selections  [1,2,3,4,5] --dst_dir .t3co_results/demodata
```


**using optimiztion in sweep module** [see](https://github.com/NREL/T3CO/blob/master/docs/optimization.md#optimization-from-sweep-module-)

## Generate MD Documentation from Docstrings (For Developers)
**On Windows**

```bash
pip install --user pipx
pipx ensurepath
```

**On Mac**
```bash
brew install pipx
pipx ensurepath
```

Then from T3CO root directory
```bash
pipx install pydoc-markdown
pydoc-markdown -I . -p t3co --render-toc > docs/functions/CodeReference.md
```
for specific modules, specify the module name after `-m`:
`pydoc-markdown -I . -m t3co/sweep --render-toc > docs/functions/sweep.md`

This generates CodeReference.md including a Table of Contents from all python docstrings in the T3CO package

## Generate MKDocs server for documentation website  (For Developers)
Use the `mkdocs.yml` file to configure the documentation website on localhost. `mkdocs` and `mkdocstrings` should get installed along with other dependencies when running `pip install -e .` from the root directory. In case it throws an error, these packages can be installed separately:
```bash
pip install mkdocs mkdocstrings-python
```
**On Mac**

List the processes using the 8000 port on localhost using the command:
```bash
lsof -i tcp:8000
```
if a PID number shows up in the list for a process called `Python`, clear the port by killing it by replacing <PID> in the following command: 
```bash
kill -9 <PID>
```
Once the port is cleared, run the following line from the T3CO root directory to generate an MKDocs interactive documentation website on your localhost
```bash
mkdocs serve
```
