Skip to content

Commit

Permalink
Package (#18)
Browse files Browse the repository at this point in the history
* Add failure and repair probability parameters for generation types

* Add pyproject.toml for project configuration and dependencies
  • Loading branch information
boyuan276 authored Dec 5, 2024
1 parent f1ede33 commit bf56a87
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 3 deletions.
31 changes: 31 additions & 0 deletions nygrid/gen_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,37 @@
"Load": {"Load": 0} # Load
}

FAILURE_PROB = {
"CC": {"NG": 0.002193},
"CT": {"NG": 0.002193, "FO2": 0.002193, "KER": 0.002193},
"ST": {"NG": 0.002193, "FO6": 0.002193, "BIT": 0.002193},
"NU": {"UR": 0.001289}, # Nuclear
"HY": {"WAT": 0.000505}, # Hydro
"Import": {"Import": 0.0},
"WT": {"WND": 0.0}, # Wind
"PV": {"SUN": 0.0}, # Solar
"PS": {"WAT": 0.0}, # Pumped storage
"ES": {"BAT": 0.0}, # Battery
"Other": {"Other": 0.0}, # Other renewable
"Load": {"Load": 0.0} # Load
}


REPAIR_PROB = {
"CC": {"NG": 0.030303},
"CT": {"NG": 0.032258, "FO2": 0.032258, "KER": 0.032258},
"ST": {"NG": 0.016667, "FO6": 0.016667, "BIT": 0.016667},
"NU": {"UR": 0.006667}, # Nuclear
"HY": {"WAT": 0.10000}, # Hydro
"Import": {"Import": 1.0},
"WT": {"WND": 1.0}, # Wind
"PV": {"SUN": 1.0}, # Solar
"PS": {"WAT": 1.0}, # Pumped storage
"ES": {"BAT": 1.0}, # Battery
"Other": {"Other": 1.0}, # Other renewable
"Load": {"Load": 1.0} # Load
}


def calc_heat_rate(data, gen_info, x_name, y_name,
calc_eco_min=False,
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "nygrid"
version = "0.1.0" # Update this to match your version
description = "A python version of the NYgrid model"
readme = "README.md" # Adjust if your README file is named differently
license = {text = "MIT License"}
authors = [
{name = "The NYgrid-python Developers", email = "[email protected]"}
]
maintainers = [
{name = "Bo Yuan", email = "[email protected]"}
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3 :: Only",
]
keywords = ["Power system", "Renewable energy", "Optimization"]
dependencies = [
"numpy",
"scipy",
"pandas",
"pyomo",
"pypower",
"matplotlib",
"openpyxl"
]
requires-python = ">=3.7"
urls = {homepage = "https://github.com/boyuan276/NYgrid-python"}

[tool.setuptools]
packages = ["nygrid"] # If your package is a directory named nygrid

[project.optional-dependencies]
dev = ["pytest", "black"]
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
PLATFORMS = "Any"
PACKAGES = find_packages()
SCRIPTS = []
PACKAGE_DATA = {
# "cmaqpy": ["cmaqpy/data/*"],
}
PACKAGE_DATA = {}
INSTALL_REQUIRES = [
"numpy",
"scipy",
Expand Down

0 comments on commit bf56a87

Please sign in to comment.