Skip to content

Commit

Permalink
bump to v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dec-heim committed Feb 18, 2023
1 parent 6f21257 commit c80075a
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 54 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
project = 'NEMGLO'
copyright = '2022, Declan Heim'
author = 'Declan Heim'
release = '0.2.2'
release = '0.3.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nemglo"
version = "0.2.2"
version = "0.3.0"
description = "Green-energy Load Optimisation tool for the NEM"
authors = ["dec-heim <92137442+dec-heim@users.noreply.github.com>"]
license = "BSD-3-Clause license"
Expand Down
15 changes: 1 addition & 14 deletions src/nemglo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# Flask/CORS imports
from flask import Flask, request, jsonify, abort
from flask_cors import CORS, cross_origin
# app = Flask(__name__)

# Flask
if getattr(sys, 'frozen', False):
Expand Down Expand Up @@ -55,10 +54,6 @@ def api_get_market_data():
conf = request.json
return get_market_data(conf)
except:
# with open(LOG_FILEPATH, 'r') as file:
# logfile = file.read()
# err_message = logfile.split('200 -')[-1:]
# abort(500, err_message[0])
throw_error_log()


Expand All @@ -69,10 +64,6 @@ def api_get_generator_data():
conf = request.json
return get_generator_data(conf)
except:
# with open(LOG_FILEPATH, 'r') as file:
# logfile = file.read()
# err_message = logfile.split('200 -')[-1:]
# abort(500, err_message[0])
throw_error_log()


Expand All @@ -84,16 +75,12 @@ def api_get_data():
print(conf)
return get_operation(conf)
except:
# with open(LOG_FILEPATH, 'r') as file:
# logfile = file.read()
# err_message = logfile.split('200 -')[-1:]
# abort(500, err_message[0])
throw_error_log()


def run(port=5000):
print("\n======================================================================\n"+\
"Access NEMGLO-app (web interface) at: https://www.nemglo.org/simulator \n"+\
"Access NEMGLO-app (user-interface) see: https://www.nemglo.org/start \n"+\
"======================================================================\n")
app.run(port=port)

Expand Down
21 changes: 0 additions & 21 deletions src/nemglo/backend/solver_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,7 @@ def add_constraints_bigM(self, lhs_df, bigM_df):
else:
raise Exception("Error with format of inequality type")
self.m.add_constr(constraint, name=str(idx))

def add_sos_type_2_ARCHIVE(self, sos_2_df):

#self._decision_vars[lhs_var_idx]

for interval in sos_2_df['interval'].unique()[0:1]:

sos_entry = sos_2_df[sos_2_df['interval']==interval]

#sos_entry['sos_varid'] = sos_entry['sos_varid'].apply(lambda x: self._decision_vars[x])
sos_entry['sos_varid'].update(pd.Series(self._decision_vars))

tupleobj = [(sos_entry.loc[row,'sos_varid'], sos_entry.loc[row,'sos_val']) for row in sos_entry.index]

self.m.add_sos(tupleobj,2)

# pass in tuple with weight var name and x-point


#self.m.add_sos(,2)
return

def add_sos_type_2(self, sos_name, weights_df, x_samples, y_samples, xvar_df, yvar_df):

Expand Down Expand Up @@ -189,7 +169,6 @@ def add_sos_type_2(self, sos_name, weights_df, x_samples, y_samples, xvar_df, yv
y_link = xsum([weights[i]*y_samples[i] for i in range(len(y_samples))]) == yvar
self.m.add_constr(y_link, name=sos_name+"_ylink")


return

def optimise(self):
Expand Down
9 changes: 0 additions & 9 deletions src/nemglo/components/electrolyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,6 @@ def _set_production_target(self, target_value=100, bound="max", period="hour"):
"""
planner = self._system_plan

# Create variable production target, set equal to value
# Set sum of lhs params equal to, greater than or less than variable on rhs dynamic

# consider what happens if timseries data input is hourly but requests < hourly period
# consider what happens if timeseries data stops midway through week, how to consider last week?

# Create a production target variable on selected intervals determined by `period`

# production target == p1 + p2 + p3
original = pd.DataFrame(index=planner._timeseries, data={'interval':range(planner._n)})
original['TimeBegin'] = original.index - timedelta(minutes=planner._intlength)

Expand Down
8 changes: 0 additions & 8 deletions src/nemglo/components/emissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ def add_emissions(self):
coefficient_list=coeffs)




def _price_emissions(self):
planner = self._system_plan
co2_name = self._id + '-impact_emissions'
Expand Down Expand Up @@ -136,10 +134,4 @@ def _set_emissions_limit(self, limit_value): #limit_value in tCo2/tH2
create_constr_rhs_dynamicvar(planner, constr_name=const_nm, constr_type=">=", rhs_var_id=rhs_var_id)
create_constr_lhs_on_interval(planner, constr_name=const_nm, constr_rhs=planner._constr_rhs_dynamic[const_nm],\
coefficient_map={prodsum_name: limit_value})

# sum emissions <= 3 * h2 production
# tCO2/MWh
# 100 tCO2 for 1000 kg
# kg CO2 per kg H2


0 comments on commit c80075a

Please sign in to comment.