Skip to content

Frozen Dataset Object mechanic not working #38

@SickSmile1

Description

@SickSmile1

In the case if object is used as a dataset instead of the class DataSetCreator, the frozen mechanic does not work and the same proto dataset can be frozen multiple times with changes of the dataset in between.

Example to recreate issue:

timestamp = str(time.time())
current_dir = os.getcwd()
data_dir2 = os.path.join(current_dir,timestamp+"_data")

os.makedirs(data_dir2, exist_ok=True)

with open("jupyter_test_file.txt", "w") as f:
    f.write("This is a test file")

new_dataset = dtoolcore.create_proto_dataset(
    name="my-dataset",
    base_uri=data_dir2
)

new_dataset.put_item( "jupyter_test_file.txt", "jupyter_test_file.txt")

readme = yaml.dump(    dict(
        description="For demonstation purposes only",
        project="Today's test project.",
        author="Johannes Laurin Hoermann",
        username="jotelha",
        orcid="0000-0001-5867-695X",
        organization="University of Freiburg",
        program="Haushaltsstelle"
    ))
new_dataset.put_readme(readme)

new_dataset.freeze()

# second file after new_dataset is frozen 
with open("another_jupyter_test_file.txt", "w") as f:
    f.write("This is another test file")

new_dataset.put_item( "another_jupyter_test_file.txt", "another_jupyter_test_file.txt")

new_dataset.freeze() 
# freezing a frozen dataset object doesnt produce an error. 
# the cli confirms the frozen status after the first freeze

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions