Skip to content

Commit

Permalink
updating workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ebalogun01 committed Dec 13, 2023
1 parent ed6f1d5 commit 47d7559
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test oneshot app
- name: Test with pytest
run: |
python3 app.py
pytest
10 changes: 8 additions & 2 deletions charging_sim/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def __init__(self, config, storage=None, solar=None):
# controller should be estimating this from time to time. Or decide how it is updated?

if self.config["electricity_rate_plan"] == "PGEBEV2S":
self.pge_gamma = cp.Variable(1, integer=True)
if self.config['opt_solver'].lower() == 'gurobi':
self.pge_gamma = cp.Variable(1, integer=True) # Only Gurobi is proven to be reliable with mixed-integers
else:
self.pge_gamma = cp.Variable(1, integer=False)
self.pge_gamma_constraint = [self.pge_gamma >= 1]
self.battery_power = cp.Variable((num_steps, 1))
self.battery_current_grid = cp.Variable((num_steps, 1), nonneg=True)
Expand Down Expand Up @@ -212,7 +215,10 @@ def __init__(self, config, storage=None, solar=None, num_steps=96):
# controller should be estimating this from time to time. Or decide how it is updated?

if self.config["electricity_rate_plan"] == "PGEBEV2S":
self.pge_gamma = cp.Variable(1, integer=True)
if self.config['opt_solver'].lower() == 'gurobi':
self.pge_gamma = cp.Variable(1, integer=True) # Only Gurobi is proven to be reliable with mixed-integers
else:
self.pge_gamma = cp.Variable(1, integer=False)
self.pge_gamma_constraint = [self.pge_gamma >= 1]
self.battery_power = cp.Variable((num_steps, 1))
self.battery_current_grid = cp.Variable((num_steps, 1), nonneg=True)
Expand Down
6 changes: 3 additions & 3 deletions default_user_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
},
"battery": {
"data": null,
"max_c_rate": [0.1, 0.2, 0.5, 1, 2],
"pack_max_voltage": [400, 400, 400, 400, 400],
"pack_energy_cap": [5e4, 10e4, 20e4, 40e4, 80e4],
"max_c_rate": [0.1, 0.2],
"pack_max_voltage": [400, 400],
"pack_energy_cap": [5e4, 10e4],
"pack_max_Ah": [250, 400],
"SOC_min": 0.2,
"SOC_max": 0.9,
Expand Down

0 comments on commit 47d7559

Please sign in to comment.