Skip to content

Commit

Permalink
opf: add a work around for pandas bug #12050
Browse files Browse the repository at this point in the history
  • Loading branch information
coroa committed Jan 18, 2016
1 parent 12d8120 commit dac9299
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from .pf import calculate_dependent_values, find_slack_bus

from itertools import chain
from distutils.version import StrictVersion

import pandas as pd

Expand Down Expand Up @@ -410,6 +411,9 @@ def define_linear_objective(network,snapshots):


def extract_optimisation_results(network,snapshots):
if isinstance(snapshots, pd.DatetimeIndex) and StrictVersion(pd.version.version) < '0.18.0':
# Work around pandas bug #12050 (https://github.com/pydata/pandas/issues/12050)
snapshots = list(snapshots)

#get value of objective function
network.objective = network.results["Problem"][0]["Lower bound"]
Expand Down

0 comments on commit dac9299

Please sign in to comment.