Skip to content

Commit

Permalink
Fix for ensemble table
Browse files Browse the repository at this point in the history
  • Loading branch information
IKCAP committed Oct 17, 2023
1 parent 8980454 commit 4870bb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pylipd/lipd.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,11 @@ def get_ensemble_tables(self, dsname = None, ensembleVarName = None, ensembleDep
query = query.replace("[ensembleDepthVarName]", ensembleDepthVarName)

qres, qres_df = self.query(query)


nan_replace = re.compile(re.escape('NaN'), re.IGNORECASE)

qres_df['ensembleDepthValues']=qres_df['ensembleDepthValues'].apply(lambda row : np.fromstring(row.strip("[]"), sep=','))
qres_df['ensembleVariableValues']=qres_df['ensembleVariableValues'].apply(lambda row : np.array(ast.literal_eval(row)))
qres_df['ensembleVariableValues']=qres_df['ensembleVariableValues'].apply(lambda row : np.array(ast.literal_eval(nan_replace.sub(row, 'None'))))


return qres_df
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pylipd
version = 1.3.7.b0
version = 1.3.7.b1
author = Varun Ratnakar, Deborah Khider
author_email = [email protected]
description= Python utilities for handling LiPD data
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from setuptools import setup, find_packages

version = '1.3.7.b0'
version = '1.3.7.b1'

# Read the readme file contents into variable
def read(fname):
Expand Down

0 comments on commit 4870bb2

Please sign in to comment.