verdict.py
def recursive_save( current_path, key, item ):
                '''Function for recursively saving to an hdf5 file.

                Args:
                    current_path (str):
                        Current location in the hdf5 file.

                    key (str):
                        Key to save.

                    item:
                        Item to save.
                '''

                # Update path
                current_path = '{}/{}'.format( current_path, key )

                # Convert missed dictionaries into verdict versions
                if isinstance( item, dict ):
                    item = Dict( item )

                if isinstance( item, Dict ):

                    # Make space for the data set
                    f.create_group( current_path )

                    # Save in condensed format
                    if condensed and item.depth() == 2:
                        df = item.to_df()

                        recursive_save(
                            current_path,
                            df.index.name,
                            df.index.values.astype( str )
                        )
                        for c_name in df.columns:
                            recursive_save(
                                current_path,
                                c_name,
                                df[c_name].values,
                            )

                    else:
                        # Recurse
                        for inner_key, inner_item in item.items():
                            recursive_save( current_path, inner_key, inner_item )

                # Save data if the inner item isn't a Dict
                else:

                    # Save a jagged array
                    if handle_jagged_arrs != 'assume_none':
                        if check_if_jagged_arr( item ):

                            create_dataset_jagged_arr(
                                f,
                                current_path,
                                item,
                                method = handle_jagged_arrs,
                                jagged_flag = jagged_flag,
                                hdf5_module = hdf5_module,
                            )
                        else:
                            create_dataset_fixed( f, current_path, item, hdf5_module=hdf5_module )
                    else:
                        create_dataset_fixed( f, current_path, item, hdf5_module=hdf5_module )
Function for recursively saving to an hdf5 file.

                Args:
                    current_path (str):
                        Current location in the hdf5 file.

                    key (str):
                        Key to save.

                    item:
                        Item to save.
                
Function for recursively saving to an hdf5 file.
Function for recursively saving to an hdf5 file .
def recursive_save( current_path, key, item ):
                current_path = '{}/{}'.format( current_path, key )
                if isinstance( item, dict ):
                    item = Dict( item )
                if isinstance( item, Dict ):
                    f.create_group( current_path )
                    if condensed and item.depth() == 2:
                        df = item.to_df()
                        recursive_save(
                            current_path,
                            df.index.name,
                            df.index.values.astype( str )
                        )
                        for c_name in df.columns:
                            recursive_save(
                                current_path,
                                c_name,
                                df[c_name].values,
                            )
                    else:
                        for inner_key, inner_item in item.items():
                            recursive_save( current_path, inner_key, inner_item )
                else:
                    if handle_jagged_arrs != 'assume_none':
                        if check_if_jagged_arr( item ):
                            create_dataset_jagged_arr(
                                f,
                                current_path,
                                item,
                                method = handle_jagged_arrs,
                                jagged_flag = jagged_flag,
                                hdf5_module = hdf5_module,
                            )
                        else:
                            create_dataset_fixed( f, current_path, item, hdf5_module=hdf5_module )
                    else:
                        create_dataset_fixed( f, current_path, item, hdf5_module=hdf5_module )
def recursive_save ( current_path , key , item ) : current_path = '{}/{}' . format ( current_path , key ) if isinstance ( item , dict ) : item = Dict ( item ) if isinstance ( item , Dict ) : f . create_group ( current_path ) if condensed and item . depth ( ) == 2 : df = item . to_df ( ) recursive_save ( current_path , df . index . name , df . index . values . astype ( str ) ) for c_name in df . columns : recursive_save ( current_path , c_name , df [ c_name ] . values , ) else : for inner_key , inner_item in item . items ( ) : recursive_save ( current_path , inner_key , inner_item ) else : if handle_jagged_arrs != 'assume_none' : if check_if_jagged_arr ( item ) : create_dataset_jagged_arr ( f , current_path , item , method = handle_jagged_arrs , jagged_flag = jagged_flag , hdf5_module = hdf5_module , ) else : create_dataset_fixed ( f , current_path , item , hdf5_module = hdf5_module ) else : create_dataset_fixed ( f , current_path , item , hdf5_module = hdf5_module )
Function for recursively saving to an hdf5 file.
Function for recursively saving to an hdf5 file .
'''Function for recursively saving to an hdf5 file.

                Args:
                    current_path (str):
                        Current location in the hdf5 file.

                    key (str):
                        Key to save.

                    item:
                        Item to save.
                ''' # Update path # Convert missed dictionaries into verdict versions # Make space for the data set # Save in condensed format # Recurse # Save data if the inner item isn't a Dict # Save a jagged array
current_path
Current location in the hdf5 file.
Current location in the hdf5 file .
key
Key to save.
Key to save .
item
Item to save.
Item to save .