Skip to content

Commit

Permalink
fix: datetime format string not quoted (fire)
Browse files Browse the repository at this point in the history
  • Loading branch information
ojdo committed Feb 6, 2015
1 parent 1dd0b6d commit 83e667e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ result analysis scripts might be needed. These can be built on top of the
following two **medium-level** functions. They retrieve all time-dependent and
-independent quantities and return them as ready-to-use DataFrames.

.. function:: urbs.get_constants(prob)
.. function:: get_constants(prob)

Return summary DataFrames for time-independent variables

Expand All @@ -132,7 +132,7 @@ following two **medium-level** functions. They retrieve all time-dependent and
:return: tuple of constants (costs, process, transmission, storage)


.. function:: urbs.get_timeseries(prob, com, sit, timesteps=None)
.. function:: get_timeseries(prob, com, sit, timesteps=None)

Return DataFrames of all timeseries referring to a given commodity and site

Expand Down
9 changes: 5 additions & 4 deletions urbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def create_model(data, timesteps=None, dt=1):
"""
m = pyomo.ConcreteModel()
m.name = 'URBS'
m.created = datetime.now().strftime(%Y%m%dT%H%M%S)
m.created = datetime.now().strftime('%Y%m%dT%H%M%S')

# Optional
if not timesteps:
Expand All @@ -151,7 +151,8 @@ def create_model(data, timesteps=None, dt=1):
m.transmission = data['transmission']
m.storage = data['storage']
m.demand = data['demand']
m.supim = data['supim']
m.supim = data['supim']
m.timesteps = timesteps

# process input/output ratios
m.r_in = m.process_commodity.xs('In', level='Direction')['ratio']
Expand All @@ -166,14 +167,14 @@ def create_model(data, timesteps=None, dt=1):

# generate ordered time step sets
m.t = pyomo.Set(
initialize=m.settings['timesteps'],
initialize=m.timesteps,
ordered=True,
doc='Set of timesteps')

# modelled (i.e. excluding init time step for storage) time steps
m.tm = pyomo.Set(
within=m.t,
initialize=m.settings['timesteps'][1:],
initialize=m.timesteps[1:],
ordered=True,
doc='Set of modelled timesteps')

Expand Down

0 comments on commit 83e667e

Please sign in to comment.