Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend checks for file_exist_check #125

Open
jbusecke opened this issue Feb 21, 2022 · 0 comments
Open

Extend checks for file_exist_check #125

jbusecke opened this issue Feb 21, 2022 · 0 comments

Comments

@jbusecke
Copy link
Owner

I have implemented a check to see if all zarr chunks were written in another project:

def _check_zarr_complete(store):
    zg = zarr.open_group(str(store))
    arrays = list(zg.arrays())
    complete = True
    for array in arrays:
        va = array[0]# variable name
        info_items = zg[va].info_items()
        # extract chunks initialized
        chunks_initialized = np.array([a for a in info_items if a[0]=='Chunks initialized'][0][1].split('/')).astype(int)        
        all_initialized = np.diff(np.array(chunks_initialized))
        # I had a case with 3/1 chunks initialized...not sure where that was from...
        # TODO: Find out under which circumstances this could happen and if >0 is ok as criterion. 
        # This was a string dimension variable in the case I encountered
        if all_initialized > 0: 
            
            complete = False
            print(f'{va} not fully written')
#             print(info_items)
    return complete

This could be implemented in file_exist_check

@jbusecke jbusecke changed the title Extend Extend checks for file_exist_check Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant