Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply black format to the whole repository #25

Merged
merged 5 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ jobs:
options: "-S -C --check --diff"
- name: Spell Check
uses: crate-ci/typos@master

with:
config: ./.github/workflows/typos.toml
5 changes: 5 additions & 0 deletions .github/workflows/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[default.extend-words]
# Ignore HDA
hda = "hda"
HDA = "HDA"
equil = "equil"
64 changes: 32 additions & 32 deletions gdplib/biofuel/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def build_model():
Returns
-------
Pyomo.ConcreteModel
The Pyomo concrete model which descibes the multiperiod location-allocation optimization model designed to determine the most cost-effective network layout and production allocation to meet market demands.
The Pyomo concrete model which describes the multiperiod location-allocation optimization model designed to determine the most cost-effective network layout and production allocation to meet market demands.

References
----------
Expand Down Expand Up @@ -72,7 +72,7 @@ def discount_factor(m, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
t : int
Index of time in months from 0 to 120 (10 years)

Expand All @@ -97,7 +97,7 @@ def market_demand(m, mkt, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
mkt : int
Index of the market from 1 to 10
t : int
Expand All @@ -121,7 +121,7 @@ def available_supply(m, sup, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
sup : int
Index of the supplier from 1 to 10
t : int
Expand Down Expand Up @@ -149,7 +149,7 @@ def supplier_x(m, sup):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
sup : int
Index of the supplier from 1 to 10

Expand All @@ -168,7 +168,7 @@ def supplier_y(m, sup):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
sup : int
Index of the supplier from 1 to 10

Expand All @@ -187,7 +187,7 @@ def market_x(m, mkt):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
mkt : int
Index of the market from 1 to 10

Expand All @@ -206,7 +206,7 @@ def market_y(m, mkt):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
mkt : int
Index of the market from 1 to 10

Expand All @@ -225,7 +225,7 @@ def site_x(m, site):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12

Expand All @@ -244,7 +244,7 @@ def site_y(m, site):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12

Expand All @@ -263,7 +263,7 @@ def dist_supplier_to_site(m, sup, site):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
sup : int
Index of the supplier from 1 to 10
site : int
Expand All @@ -287,7 +287,7 @@ def dist_site_to_market(m, site, mkt):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12
mkt : int
Expand Down Expand Up @@ -362,7 +362,7 @@ def raw_material_unit_cost(m, sup, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
sup : int
Index of the supplier from 1 to 10
t : int
Expand All @@ -383,7 +383,7 @@ def module_unit_cost(m, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
t : int
Index of time in months from 0 to 120 (10 years)

Expand All @@ -402,7 +402,7 @@ def unit_production_cost(m, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
t : int
Index of time in months from 0 to 120 (10 years)

Expand All @@ -421,7 +421,7 @@ def transport_fixed_cost(m):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model

Returns
-------
Expand All @@ -438,7 +438,7 @@ def unit_product_transport_cost(m, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
t : int
Index of time in months from 0 to 120 (10 years)

Expand All @@ -457,7 +457,7 @@ def unit_raw_material_transport_cost(m, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
t : int
Index of time in months from 0 to 120 (10 years)

Expand Down Expand Up @@ -493,7 +493,7 @@ def supply_limits(m, sup, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
sup : int
Index of the supplier from 1 to 10
t : int
Expand All @@ -517,7 +517,7 @@ def demand_satisfaction(m, mkt, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
mkt : int
Index of the market from 1 to 10
t : int
Expand All @@ -541,7 +541,7 @@ def product_balance(m, site, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12
t : int
Expand All @@ -564,7 +564,7 @@ def require_raw_materials(m, site, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12
t : int
Expand Down Expand Up @@ -625,7 +625,7 @@ def site_type(m, site):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12

Expand All @@ -644,7 +644,7 @@ def supply_route_active_or_not(m, sup, site):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
sup : int
Index of the supplier from 1 to 10
site : int
Expand All @@ -665,7 +665,7 @@ def product_route_active_or_not(m, site, mkt):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12
mkt : int
Expand All @@ -686,7 +686,7 @@ def raw_material_transport_cost(m, sup, site):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
sup : int
_description_
site : int
Expand All @@ -713,7 +713,7 @@ def raw_material_fixed_transport_cost(m):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model

Returns
-------
Expand All @@ -738,7 +738,7 @@ def product_transport_cost(m, site, mkt):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12
mkt : int
Expand All @@ -765,7 +765,7 @@ def product_fixed_transport_cost(m):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model

Returns
-------
Expand All @@ -792,7 +792,7 @@ def module_setup_cost(m, site, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12
t : int
Expand All @@ -817,7 +817,7 @@ def module_teardown_credit(m, site, t):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12
t : int
Expand All @@ -838,7 +838,7 @@ def conv_salvage_value(m, site):
Parameters
----------
m : Pyomo.ConcreteModel
Pyomo concrete model which descibes the multiperiod location-allocation optimization model
Pyomo concrete model which describes the multiperiod location-allocation optimization model
site : int
Index of the facility site from 1 to 12

Expand Down
2 changes: 1 addition & 1 deletion gdplib/gdp_col/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def monotonoic_temperature(_, t):
m.gamma = Var(
m.comps,
m.trays,
doc='liquid activity coefficent of component on tray',
doc='liquid activity coefficient of component on tray',
domain=NonNegativeReals,
bounds=(0, 10),
initialize=1,
Expand Down
2 changes: 1 addition & 1 deletion gdplib/gdp_col/fenske.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def calculate_Fenske(xD, xB):
m.gamma = Var(
m.comps,
m.trays,
doc='liquid activity coefficent of component on tray',
doc='liquid activity coefficient of component on tray',
domain=NonNegativeReals,
bounds=(0, 10),
initialize=1,
Expand Down
8 changes: 2 additions & 6 deletions gdplib/gdp_col/initialize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Initialization routine for distillation column"""

from __future__ import division

import pandas
Expand Down Expand Up @@ -173,12 +174,7 @@ def set_value_if_not_fixed(var, val):
m.Pvap[c, t].set_value(
value(
exp(
(
k['A'] * x
+ k['B'] * x**1.5
+ k['C'] * x**3
+ k['D'] * x**6
)
(k['A'] * x + k['B'] * x**1.5 + k['C'] * x**3 + k['D'] * x**6)
/ (1 - x)
)
* k['Pc']
Expand Down
Loading
Loading