verdict.py
def create_dataset_jagged_arr(
        f,
        current_path,
        arr,
        method = 'filled array',
        fill_value = None,
        jagged_flag = 'jagged',
        hdf5_module = h5py,
    ):
    '''Create a dataset for saving an jagged array.

    Args:
        f (open hdf5 file):
            File to create the dataset on.

        current_path (str):
            Location in the file to save the array to.

        arr (array-like):
            Uneven array to save.

        fill_value :
            Fill value to use when using the filled arr method.

        jagged_flag (str):
            Flag to indicate that this part of the hdf5 file contains part of
            an jagged array-like.
    '''

    if method == 'filled array':

        filled_arr, fill_value = jagged_arr_to_filled_arr( arr, fill_value )

        attrs = {
            'jagged saved as filled': True,
            'fill value': fill_value
        }
        create_dataset_fixed( f, current_path, filled_arr, hdf5_module, attrs=attrs )

    elif method == 'row datasets':
        for i, v in enumerate( arr ):

            used_path = '{}/{}{}'.format( current_path, jagged_flag, i )

            # If v is an jagged array, recurse
            if check_if_jagged_arr( v ):
                create_dataset_jagged_arr(
                    f,
                    used_path,
                    v,
                    method = method,
                    jagged_flag = jagged_flag,
                    hdf5_module = hdf5_module,
                )
            else:
                create_dataset_fixed( f, used_path, v, hdf5_module )

    else:
        raise ValueError( 'Unrecognized jagged arr dataset method, {}'.format( method ) )
Create a dataset for saving an jagged array.

    Args:
        f (open hdf5 file):
            File to create the dataset on.

        current_path (str):
            Location in the file to save the array to.

        arr (array-like):
            Uneven array to save.

        fill_value :
            Fill value to use when using the filled arr method.

        jagged_flag (str):
            Flag to indicate that this part of the hdf5 file contains part of
            an jagged array-like.
    
Create a dataset for saving an jagged array.
Create a dataset for saving an jagged array .
def create_dataset_jagged_arr(
        f,
        current_path,
        arr,
        method = 'filled array',
        fill_value = None,
        jagged_flag = 'jagged',
        hdf5_module = h5py,
    ):
    if method == 'filled array':
        filled_arr, fill_value = jagged_arr_to_filled_arr( arr, fill_value )
        attrs = {
            'jagged saved as filled': True,
            'fill value': fill_value
        }
        create_dataset_fixed( f, current_path, filled_arr, hdf5_module, attrs=attrs )
    elif method == 'row datasets':
        for i, v in enumerate( arr ):
            used_path = '{}/{}{}'.format( current_path, jagged_flag, i )
            if check_if_jagged_arr( v ):
                create_dataset_jagged_arr(
                    f,
                    used_path,
                    v,
                    method = method,
                    jagged_flag = jagged_flag,
                    hdf5_module = hdf5_module,
                )
            else:
                create_dataset_fixed( f, used_path, v, hdf5_module )
    else:
        raise ValueError( 'Unrecognized jagged arr dataset method, {}'.format( method ) )
def create_dataset_jagged_arr ( f , current_path , arr , method = 'filled array' , fill_value = None , jagged_flag = 'jagged' , hdf5_module = h5py , ) : if method == 'filled array' : filled_arr , fill_value = jagged_arr_to_filled_arr ( arr , fill_value ) attrs = { 'jagged saved as filled' : True , 'fill value' : fill_value } create_dataset_fixed ( f , current_path , filled_arr , hdf5_module , attrs = attrs ) elif method == 'row datasets' : for i , v in enumerate ( arr ) : used_path = '{}/{}{}' . format ( current_path , jagged_flag , i ) if check_if_jagged_arr ( v ) : create_dataset_jagged_arr ( f , used_path , v , method = method , jagged_flag = jagged_flag , hdf5_module = hdf5_module , ) else : create_dataset_fixed ( f , used_path , v , hdf5_module ) else : raise ValueError ( 'Unrecognized jagged arr dataset method, {}' . format ( method ) )
Create a dataset for saving an jagged array.
Create a dataset for saving an jagged array .
'''Create a dataset for saving an jagged array.

    Args:
        f (open hdf5 file):
            File to create the dataset on.

        current_path (str):
            Location in the file to save the array to.

        arr (array-like):
            Uneven array to save.

        fill_value :
            Fill value to use when using the filled arr method.

        jagged_flag (str):
            Flag to indicate that this part of the hdf5 file contains part of
            an jagged array-like.
    ''' # If v is an jagged array, recurse
f
File to create the dataset on.
File to create the dataset on .
current_path
Location in the file to save the array to.
Location in the file to save the array to .
arr
Uneven array to save.
Uneven array to save .
method
fill_value
jagged_flag
Flag to indicate that this part of the hdf5 file contains part of
an jagged array-like.
Flag to indicate that this part of the hdf5 file contains part of an jagged array - like .
hdf5_module
fill_value 
Fill value to use when using the filled arr method.
Fill value to use when using the filled arr method .