Skip to content

Commit

Permalink
Merge branch 'f2-doc-fields' of github.com:NREL/fastsim into f2-doc-f…
Browse files Browse the repository at this point in the history
…ields
  • Loading branch information
calbaker committed Aug 14, 2023
2 parents 38517f1 + acdf481 commit c223ab5
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 148 deletions.
232 changes: 170 additions & 62 deletions LICENSE

Large diffs are not rendered by default.

69 changes: 0 additions & 69 deletions LICENSE.md

This file was deleted.

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE LICENSE.md build_and_test.sh BUILD.md
include LICENSE build_and_test.sh BUILD.md NOTICE
include rust/Cargo.toml rust/fastsim-core/Cargo.toml rust/fastsim-core/proc-macros/Cargo.toml rust/fastsim-py/Cargo.toml rust/fastsim-cli/Cargo.toml
recursive-include rust/fastsim-core/src *
recursive-include rust/fastsim-core/proc-macros/src *
Expand Down
13 changes: 13 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2020 Alliance for Sustainable Energy, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
30 changes: 16 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ version = "2.1.0"
authors = [{ name = "NREL/MTES/CIMS/MBAP Group", email = "[email protected]" }]
description = "Tool for modeling vehicle powertrains"
readme = "README.md"
license = {file = "LICENSE.md"}
license = { file = "LICENSE" }
requires-python = ">=3.8,<3.11"
classifiers = [
"Programming Language :: Python :: 3",
"License :: Other/Proprietary License",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
Expand All @@ -29,29 +29,31 @@ dependencies = [
]

[project.urls]
Homepage = "https://www.nrel.gov/transportation/fastsim.html"
Homepage = "https://www.nrel.gov/transportation/fastsim.html"

[project.optional-dependencies]
dev = ["black", "maturin", "plotly", "ipykernel", "pymoo==0.6.0.1",]
dev = ["black", "maturin", "plotly", "ipykernel", "pymoo==0.6.0.1"]

[tool.setuptools]
zip-safe = false

[tool.setuptools.packages.find]
where = ["."] # list of folders that contain the packages (["."] by default)
include = ["fastsim*"] # package names should match these glob patterns (["*"] by default)
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
where = ["."] # list of folders that contain the packages (["."] by default)
include = [
"fastsim*",
] # package names should match these glob patterns (["*"] by default)
namespaces = false # to disable scanning PEP 420 namespaces (true by default)

[tool.maturin]
python-source="python"
python-source = "python"
features = ["pyo3/extension-module"]
module-name = "fastsim.fastsimrust"
manifest-path = "rust/fastsim-py/Cargo.toml"
include = [
{ format = "sdist", path = "rust/fastsim-core/Cargo.toml"},
{ format = "sdist", path = "rust/fastsim-core/src/*"},
{ format = "sdist", path = "rust/fastsim-core/proc-macros/Cargo.toml"},
{ format = "sdist", path = "rust/fastsim-core/proc-macros/src/*"},
{ format = "sdist", path = "rust/fastsim-py/Cargo.toml"},
{ format = "sdist", path = "rust/fastsim-py/src/*"},
{ format = "sdist", path = "rust/fastsim-core/Cargo.toml" },
{ format = "sdist", path = "rust/fastsim-core/src/*" },
{ format = "sdist", path = "rust/fastsim-core/proc-macros/Cargo.toml" },
{ format = "sdist", path = "rust/fastsim-core/proc-macros/src/*" },
{ format = "sdist", path = "rust/fastsim-py/Cargo.toml" },
{ format = "sdist", path = "rust/fastsim-py/src/*" },
]
3 changes: 3 additions & 0 deletions rust/fastsim-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ regex = "1"
[dev-dependencies]
assert_cmd = "2.0"
predicates = "2.1"

[package.metadata]
include = ["../../NOTICE"]
1 change: 1 addition & 0 deletions rust/fastsim-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ include = [
"resources/udds.csv",
"resources/hwfet.csv",
"build.rs",
"../../NOTICE",
]

[features]
Expand Down
3 changes: 3 additions & 0 deletions rust/fastsim-core/fastsim-proc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ syn = { version = "1.0.92", features = ["full"] }

[lib]
proc-macro = true

[package.metadata]
include = ["../../../NOTICE"]
11 changes: 9 additions & 2 deletions rust/fastsim-core/src/vehicle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ pub struct RustVehicle {
pub fc_perc_out_array: Vec<f64>,
#[doc(hidden)]
#[doc_field(skip_doc)]
#[serde(skip)]
#[serde(default = "RustVehicle::default_regen_a")]
pub regen_a: f64,
#[doc(hidden)]
#[doc_field(skip_doc)]
#[serde(skip)]
#[serde(default = "RustVehicle::default_regen_b")]
pub regen_b: f64,
#[doc(hidden)]
#[doc_field(skip_doc)]
Expand Down Expand Up @@ -599,6 +599,13 @@ impl RustVehicle {
* self.props.a_grav_mps2;
}

const fn default_regen_a() -> f64 {
500.0
}
const fn default_regen_b() -> f64 {
0.99
}

pub fn max_regen_kwh(&self) -> f64 {
0.5 * self.veh_kg * (27.0 * 27.0) / (3_600.0 * 1_000.0)
}
Expand Down
3 changes: 3 additions & 0 deletions rust/fastsim-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ log = "0.4.17"
[lib]
name = "fastsimrust"
crate-type = ["cdylib"]

[package.metadata]
include = ["../../NOTICE"]

0 comments on commit c223ab5

Please sign in to comment.