Skip to content

Commit

Permalink
Remove deprecated pandas lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklise committed Nov 18, 2023
1 parent 86c7c1a commit 9a288a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions chama/impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,13 @@ def detection_time_to_impact(detection_time, impact_data):
impact_data.interpolate(inplace=True)

det_damage = detection_time.copy()
det_damage['T'] = impact_data.lookup(detection_time['T'],
detection_time['Scenario'])
det_damage.rename(columns={'T': 'Impact'}, inplace=True)

times = detection_time['T']
scenarios = detection_time['Scenario']
impact_vals = impact_data.to_numpy()[impact_data.index.get_indexer(times),
impact_data.columns.get_indexer(scenarios)]
det_damage['Impact'] = impact_vals
del det_damage['T']

return det_damage


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Required
pyomo
pandas<2.0
pandas
numpy
scipy

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
MAINTAINER_EMAIL = '[email protected]'
LICENSE = 'Revised BSD'
URL = 'https://github.com/sandialabs/chama'
DEPENDENCIES = ['pyomo', 'pandas<2.0', 'numpy', 'scipy']
DEPENDENCIES = ['pyomo', 'pandas', 'numpy', 'scipy']

# use README file as the long description
file_dir = os.path.abspath(os.path.dirname(__file__))
Expand Down

0 comments on commit 9a288a9

Please sign in to comment.