Skip to main content

Gearshift tool implement the Sub-Annex 1 and Sub-Annex 2 of theCOMMISSION REGULATION (EU) 2017/1151 of 1 June 2017 - Annex XXI

Project description

GitLab repository

versions:

Latest version in GitHub release date Supported Python versions of latest release in PyPi

documentation:

https://gearshift-calculation-tool.readthedocs.io/en/latest/ GitHub page documentation

sources:

https://code.europa.eu/jrc-ldv/jrshift pip installation Code Style

keywords:

automotive, car, cars, driving, engine, emissions, fuel-consumption, gears, gearshifts, rpm, simulation, simulator, standard, vehicle, vehicles, WLTP

short name:

JR-Shift

live-demo:

JupyterLab for Gerashift Calculation Tool (stable)

Copyright and License:

© Copyright (c) 2021 European Union.

Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission – subsequent versions of the EUPL (the “Licence”); You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence at: EUPL 1.2

Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an “AS IS” basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licence for the specific language governing permissions and limitations under the Licence.

A python-3.6+ package to generate the gear-shifts of Light-duty vehicles

Introduction

The aim of the JR-Shift is obtain the Required Engine Speeds, the Available Powers, the Required Vehicle Speeds and the Gears for the whole WLTC based on the vehicle characteristics. The model should allow accurate calculation of final trace and the operating conditions of the engine.

Overview

The calculator accepts as input an excel file that contains the vehicle’s technical data, along with parameters for modifying the execution WLTC cycle, and it then spits-out the gear-shifts of the vehicle and the others parameters used during the obtaining of these. It does not calculate any CO2 emissions.

Installation

Prerequisites

Python-3.6+ is required and Python-3.7 recommended. It requires numpy/scipy and pandas libraries with native backends.

Download

Download the sources,

  • either with git, by giving this command to the terminal:

    git clone https://github.com/JRCSTU/gearshift_calculation_tool --depth=1

Install

From within the project directory, run one of these commands to install it:

  • for standard python, installing with pip is enough (but might):

    pip install -e .[path_to_gearshift_calculation_tool_folder]

Project files and folders

The files and folders of the project are listed below:

+--gearshift/                                       # main folder that contains the whole gearshift project
|   +--cli/                                         # folder that contains all cli scripts
|   +--core/                                        # folder that contains core packages
|       +--load/                                    # (package) python-code of the load
|           +--speed_phases/                        # folder that contains speed phases in ftr format
|           +--excel.py                             # (script) load from the excel file parameters
|       +--model/                                   # (package) python-code of the model
|           +--calculateShiftpointsNdvFullPC/       # (package) python-code of the calculate shift points, Ndv and  FullPC
|           +--scaleTrace/                          # (package) python-code of the calculate scale trace
|       +--write/                                   # (package) python-code of the write
|           +--excel.py                             # (script) write to the excel file output parameters
|   +--demos/                                       # folder that contains demo files
|   +--docs/                                        # folder that contains documentation
+-- AUTHORS.rst
+--setup.py                                         # (script) The entry point for `setuptools`, installing, testing, etc
+--README.rst
+--LICENSE.txt

Quick-Start

Cmd-line usage

The command-line usage below requires the Python environment to be installed, and provides for executing an experiment directly from the OS’s shell (i.e. cmd in windows or bash in POSIX), and in a single command. To have precise control over the inputs and outputs

$ gearshift --help                                                  ## to get generic help for cmd-line syntax
$ gearshift demo                                                    ## to get demo input file
$ gearshift run "path_input_file" -O "path_to_save_output_file"     ## to run gearshift tool

Usage

In this example we will use gearshift model in order to predict the gears.

Setup

Import dispatcher(dsp) from gearshift tool that contains functions and simulation model to process vehicle data and Import also schedula for selecting and executing functions. for more information on how to use schedula

from gearshift.core import dsp
import schedula as sh

Load data

  • Load vehicle data for a specific vehicle from excel template

    vehData = 'gs_input_demo.xlsx'
  • Define the input dictionary for the dispacher.

    input = dict(input_file_name=vehData)

Dispatcher

  • Dispatcher will select and execute the proper functions for the given inputs and the requested outputs

    core = dsp(input, outputs=['sol'], shrink=True)
  • Plot workflow of the core model from the dispatcher

    core.plot()

    This will automatically open an internet browser and show the work flow of the core model as below. You can click all the rectangular boxes to see in detail sub models like load, model, write and plot.

    alternate text

    The load module

    alternate text
  • Load outputs of dispatcher Select the chosen dictionary key (sol) from the given dictionary.

    solution = sh.selector(['sol'], sh.selector(['sol'], core))
  • Select each output case

    # Select first case
    solution['sol'][0]
    
    # Select second case case
    solution['sol'][1]
    
    # Select gears output for different cases
    gears = {}
    for sol in solution['sol']:
        gears[f'gears_{sol["Case"]}'] = sol['GearsOutput']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wltp-jrshift-2.0.3.tar.gz (304.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wltp_jrshift-2.0.3-py2.py3-none-any.whl (303.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file wltp-jrshift-2.0.3.tar.gz.

File metadata

  • Download URL: wltp-jrshift-2.0.3.tar.gz
  • Upload date:
  • Size: 304.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for wltp-jrshift-2.0.3.tar.gz
Algorithm Hash digest
SHA256 ed512638ee328d6ba0dd2c828c1acb6bebad42b06c6f2f2740a6220560695d77
MD5 a068e09f07baad9e89670fa74c344831
BLAKE2b-256 0f60fe2e67d182f082d72568dfb8384e1d4b974175334572e3670f9db392b6ff

See more details on using hashes here.

File details

Details for the file wltp_jrshift-2.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: wltp_jrshift-2.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 303.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for wltp_jrshift-2.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5ee0cfbe84a842ce728ad98c5757cf91b570f9054c45b21c855a1a50b4d09fae
MD5 7d34f2147b7377e4bb692415bc2182c1
BLAKE2b-256 1b47509ac31a12f73a002e19467bc4aaee12acf08041547d0a994b54af95e2a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page