Allow looping through cycles if max is 0
This commit is contained in:
parent
2e9b5e5bc0
commit
c02b575b54
1 changed files with 11 additions and 5 deletions
|
|
@ -41,11 +41,10 @@ def read_neware(path, options={}):
|
||||||
# Convert from .xlsx to .csv to make readtime faster
|
# Convert from .xlsx to .csv to make readtime faster
|
||||||
if path.endswith('xlsx'):
|
if path.endswith('xlsx'):
|
||||||
csv_details = ''.join(path[:-5]) + '_details.csv'
|
csv_details = ''.join(path[:-5]) + '_details.csv'
|
||||||
csv_summary = ''.join(path[:-5]) + '_summary.csv'
|
csv_summary = os.path.abspath(''.join(path[:-5]) + '_summary.csv')
|
||||||
|
|
||||||
|
|
||||||
if not os.path.isfile(csv_summary):
|
if not os.path.isfile(csv_summary):
|
||||||
Xlsx2csv(path, outputencoding="utf-8").convert(csv_summary, sheetid=3)
|
Xlsx2csv(path, outputencoding="utf-8").convert(os.path.abspath(csv_summary), sheetid=3)
|
||||||
|
|
||||||
if not os.path.isfile(csv_details):
|
if not os.path.isfile(csv_details):
|
||||||
Xlsx2csv(path, outputencoding="utf-8").convert(csv_details, sheetid=4)
|
Xlsx2csv(path, outputencoding="utf-8").convert(csv_details, sheetid=4)
|
||||||
|
|
@ -432,15 +431,17 @@ def process_biologic_data(df, options=None):
|
||||||
|
|
||||||
df = df[headers].copy()
|
df = df[headers].copy()
|
||||||
|
|
||||||
|
|
||||||
# Complete set of new units and get the units used in the dataset, and convert values in the DataFrame from old to new.
|
# Complete set of new units and get the units used in the dataset, and convert values in the DataFrame from old to new.
|
||||||
set_units(options)
|
set_units(options)
|
||||||
options['old_units'] = get_old_units(df=df, options=options)
|
options['old_units'] = get_old_units(df=df, options=options)
|
||||||
|
|
||||||
df = add_columns(df=df, options=options)
|
df = add_columns(df=df, options=options)
|
||||||
|
|
||||||
df = unit_conversion(df=df, options=options)
|
|
||||||
|
|
||||||
|
|
||||||
|
df = unit_conversion(df=df, options=options)
|
||||||
|
|
||||||
# Creates masks for charge and discharge curves
|
# Creates masks for charge and discharge curves
|
||||||
if options['mode'] == 'GC':
|
if options['mode'] == 'GC':
|
||||||
chg_mask = (df['status'] == 1) & (df['status_change'] != 1)
|
chg_mask = (df['status'] == 1) & (df['status_change'] != 1)
|
||||||
|
|
@ -453,8 +454,13 @@ def process_biologic_data(df, options=None):
|
||||||
# Initiate cycles list
|
# Initiate cycles list
|
||||||
cycles = []
|
cycles = []
|
||||||
|
|
||||||
|
if df['cycle'].max() == 0:
|
||||||
|
no_cycles = 1
|
||||||
|
else:
|
||||||
|
no_cycles = int(df['cycle'].max())
|
||||||
|
|
||||||
# Loop through all the cycling steps, change the current and capacities in the
|
# Loop through all the cycling steps, change the current and capacities in the
|
||||||
for i in range(int(df["cycle"].max())):
|
for i in range(no_cycles):
|
||||||
|
|
||||||
sub_df = df.loc[df['cycle'] == i].copy()
|
sub_df = df.loc[df['cycle'] == i].copy()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue