Skip to content

Commit

Permalink
read_gdx.Translator now captures copies of the GdxSymbol.dataframes r…
Browse files Browse the repository at this point in the history
…ather than the originals. Closes #32
  • Loading branch information
elainethale committed Oct 4, 2018
1 parent 4cf2b66 commit 6e3e3ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gdxpds/read_gdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
'''

from collections import OrderedDict
import copy
import logging

# gdxpds needs to be imported before pandas to try to avoid library conflict on
Expand Down Expand Up @@ -94,7 +93,7 @@ def dataframes(self):
for symbol in self.__gdx:
if not symbol.loaded:
symbol.load()
self.__dataframes[symbol.name] = symbol.dataframe
self.__dataframes[symbol.name] = symbol.dataframe.copy()
return self.__dataframes

@property
Expand All @@ -107,7 +106,7 @@ def dataframe(self, symbol_name):
if not self.gdx[symbol_name].loaded:
self.gdx[symbol_name].load()
# This was returning { symbol_name: dataframe }, which seems intuitively off.
return self.gdx[symbol_name].dataframe
return self.gdx[symbol_name].dataframe.copy()

def to_dataframes(gdx_file,gams_dir=None):
"""
Expand Down

0 comments on commit 6e3e3ec

Please sign in to comment.