<commit_before>"""
Saving HDF5 Files
=================

an example of saving nddata to hdf5 files, which preserves all of the nddata
information flawlessly"""
from pyspecdata import *
#init_logging('debug')
a = nddata(r_[0:5:10j], 'x')
a.name('test_data')
try:
    a.hdf5_write('example.h5',getDATADIR(exp_type='francklab_esr/Sam'))
except:
    print("file already exists, not creating again -- delete the file or node if wanted")
# read the file by the "raw method"
b = nddata_hdf5('example.h5/test_data',
        getDATADIR(exp_type='francklab_esr/Sam'))
print("found data:",b)
# or use the find file method
c = find_file('example.h5', exp_type='francklab_esr/Sam',
        expno='test_data')
print("found data:",c)<commit_msg>cleaning up<commit_after>"""
Saving HDF5 Files
=================

an example of saving nddata to hdf5 files, which preserves all of the nddata
information flawlessly"""
from pyspecdata import *
a = nddata(r_[0:5:10j], 'x')
a.name('test_data')
try:
    a.hdf5_write('example.h5',getDATADIR(exp_type='francklab_esr/Sam'))
except:
    print("file already exists, not creating again -- delete the file or node if wanted")
# read the file by the "raw method"
b = nddata_hdf5('example.h5/test_data',
        getDATADIR(exp_type='francklab_esr/Sam'))
print("found data:",b)
# or use the find file method
c = find_file('example.h5', exp_type='francklab_esr/Sam',
        expno='test_data')
print("found data:",c)
{'fraction_non_alphanumeric': 0.15701325889741802, 'fraction_numerical': 0.015352407536636426, 'mean_word_length': 5.430493273542601, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7179834', 'n_tokens_mistral': 515, 'n_tokens_neox': 515, 'n_words': 135}