File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ def get_condition_df(
4040 )
4141
4242 if not isinstance (condition_file .index , pd .RangeIndex ):
43- condition_file .reset_index (inplace = True )
43+ condition_file .reset_index (
44+ drop = condition_file .index .name != CONDITION_ID ,
45+ inplace = True ,
46+ )
4447
4548 try :
4649 condition_file .set_index ([CONDITION_ID ], inplace = True )
Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ def get_mapping_df(
3636 )
3737
3838 if not isinstance (mapping_file .index , pd .RangeIndex ):
39- mapping_file .reset_index (inplace = True )
39+ mapping_file .reset_index (
40+ drop = mapping_file .index .name != PETAB_ENTITY_ID ,
41+ inplace = True ,
42+ )
4043
4144 for col in MAPPING_DF_REQUIRED_COLS :
4245 if col not in mapping_file .columns :
Original file line number Diff line number Diff line change @@ -47,7 +47,10 @@ def get_observable_df(
4747 )
4848
4949 if not isinstance (observable_file .index , pd .RangeIndex ):
50- observable_file .reset_index (inplace = True )
50+ observable_file .reset_index (
51+ drop = observable_file .index .name != OBSERVABLE_ID ,
52+ inplace = True ,
53+ )
5154
5255 try :
5356 observable_file .set_index ([OBSERVABLE_ID ], inplace = True )
Original file line number Diff line number Diff line change @@ -82,7 +82,10 @@ def get_parameter_df(
8282 )
8383
8484 if not isinstance (parameter_df .index , pd .RangeIndex ):
85- parameter_df .reset_index (inplace = True )
85+ parameter_df .reset_index (
86+ drop = parameter_file .index .name != PARAMETER_ID ,
87+ inplace = True ,
88+ )
8689
8790 try :
8891 parameter_df .set_index ([PARAMETER_ID ], inplace = True )
You can’t perform that action at this time.
0 commit comments