Comments (2)
Inventory
Kind of obvious (in hindsight): simply call get_entity
once for each model entity returned by a call to list_entities
for each of the entity types set, parameter, variable, objective, constraint. Using this, no manual maintenance is required and all possibly interesting information is preserved.
Serialization format
Pandas supports HDF5 by relying on the PyTables package.
Internal result representation
A (possibly nested) dictionary of pandas Series:
result = {
'set': { 't': <Series>, 'tm': <Series>, 'com': <Series>, ... },
'par': { 'w': <Series>, ... },
'var': { ... },
'obj': { ... },
'con': { ... }}
Alternative: a nested AttrDict
for easier access like result.var.e_pro_out
.
Further thoughts
The choice of representation has ripple effects concerning functions get_timeseries
and get_constants
, which should switch to relying on the result representation that gets automatically updated by a solver run. This in turn calls for creating a custom class (urbs
, maybe?) that bundles this new behaviour. Then, an urbs object could either be created in its solved state by reading input + solving, or by directly loading a HDFStore file, populating the internal result data structure. Additional meta information (time stamps, scenario descriptions, notes) could transparently be added.
from urbs.
Update on internal result representation: the dictionary probably should not be nested by entity type, to make the logic of function get_entity
simpler, like:
def get_entity(instance, name):
if name in instance._result:
return instance._result[name]
else:
raise SomeException
The hidden _result
field should get populated automatically after a successful solver run. Perhaps, the output of list_entities
(entity name, type and domain) could be stored where?
from urbs.
Related Issues (20)
- Installation error: running runme.py AttributeError: module 'pandas.core' has no attribute 'index' HOT 2
- Errors while running comp.py HOT 3
- DC power flow equation unit HOT 1
- FYI: outdated case-studies 1house + 1node now reproducible
- urbs-env not working properly
- runme.py no execute properly HOT 6
- FYI: Misleading naming instructions in single_year.xlsx example input file
- urbs-env not working - ImportError: DLL load failed - PyTables HOT 1
- using urbs on Mac HOT 1
- Multi Site Electricity Trade
- runme.py throws ModuleNotFoundError error HOT 1
- in file runme.py, when it imports urbs, i get the error ModuleNotFoundError: No module named 'xlrd' HOT 1
- python comp.py fails with KeyError: 'level_0' HOT 2
- Add multi objective function for the model HOT 1
- Overpay factor calculation
- Twice investment cost of the transmission lines is calculated
- Change conversion parameters in scenarios.py HOT 1
- General problems with installation following the instructions HOT 2
- Battery storage technology HOT 1
- HiGHS for urbs?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urbs.