Commit 74f83d11 authored by Somnath, Suhas's avatar Somnath, Suhas
Browse files

Renamed ioHDF5 to HDFwrtier since that is all it does.

Also renamed writeData to write_data per PEP8
parent 33bf82dc
......@@ -76,7 +76,7 @@ data_file_path = 'temp_um.h5'
url = 'https://raw.githubusercontent.com/pycroscopy/pycroscopy/master/data/BELine_0004.h5'
_ = wget.download(url, data_file_path, bar=None)
hdf = px.ioHDF5(data_file_path)
hdf = px.HDFwriter(data_file_path)
h5_file = hdf.file
print('Contents of data file:')
......
......@@ -99,13 +99,13 @@ root_group.show_tree()
h5_path = 'microdata_test.h5'
# Then we use the ioHDF5 class to build the file from our objects.
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
##############################################################################
# The writeData method builds the hdf5 file using the structure defined by the
# MicroData objects. It returns a list of references to all h5py objects in the
# new file.
h5_refs = hdf.writeData(root_group, print_log=True)
h5_refs = hdf.write_data(root_group, print_log=True)
# We can use these references to get the h5py dataset and group objects
h5_main = px.io.hdf_utils.getH5DsetRefs(['Main_Data'], h5_refs)[0]
......
......@@ -182,7 +182,7 @@ Now that we have created the objects, we can write them to an hdf5 file
The writeData method builds the hdf5 file using the structure defined by the
The write_data method builds the hdf5 file using the structure defined by the
MicroData objects. It returns a list of references to all h5py objects in the
new file.
......@@ -190,7 +190,7 @@ new file.
.. code-block:: python
h5_refs = hdf.writeData(root_group, print_log=True)
h5_refs = hdf.write_data(root_group, print_log=True)
# We can use these references to get the h5py dataset and group objects
h5_main = px.io.hdf_utils.get_h5_obj_refs(['Main_Data'], h5_refs)[0]
......
......@@ -147,7 +147,7 @@ h5_path = tran.translate(data_file_path)
# instead.
# opening the file:
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
h5_file = hdf.file
# Visualize the tree structure in the file
......@@ -368,7 +368,7 @@ for at_name in cluster_grp.attrs:
#
# Once the tree is prepared (previous cell), ioHDF5 will handle all the file writing.
h5_clust_refs = hdf.writeData(cluster_grp, print_log=True)
h5_clust_refs = hdf.write_data(cluster_grp, print_log=True)
h5_labels = px.hdf_utils.getH5DsetRefs(['Labels'], h5_clust_refs)[0]
h5_centroids = px.hdf_utils.getH5DsetRefs(['Mean_Response'], h5_clust_refs)[0]
......
......@@ -528,7 +528,7 @@ Once the tree is prepared (previous cell), ioHDF5 will handle all the file writi
.. code-block:: python
h5_clust_refs = hdf.writeData(cluster_grp, print_log=True)
h5_clust_refs = hdf.write_data(cluster_grp, print_log=True)
h5_labels = px.hdf_utils.get_h5_obj_refs(['Labels'], h5_clust_refs)[0]
h5_centroids = px.hdf_utils.get_h5_obj_refs(['Mean_Response'], h5_clust_refs)[0]
......
......@@ -142,7 +142,7 @@ class ShoGuess(px.Process):
sho_grp.add_children([ds_guess, ds_sho_inds, ds_sho_vals])
sho_grp.attrs['SHO_guess_method'] = "pycroscopy BESHO"
h5_sho_grp_refs = self.hdf.writeData(sho_grp)
h5_sho_grp_refs = self.hdf.write_data(sho_grp)
self.h5_guess = px.hdf_utils.getH5DsetRefs(['Guess'], h5_sho_grp_refs)[0]
self.h5_results_grp = self.h5_guess.parent
......
......@@ -160,7 +160,7 @@ Note that:
sho_grp.add_children([ds_guess, ds_sho_inds, ds_sho_vals])
sho_grp.attrs['SHO_guess_method'] = "pycroscopy BESHO"
h5_sho_grp_refs = self.hdf.writeData(sho_grp)
h5_sho_grp_refs = self.hdf.write_data(sho_grp)
self.h5_guess = px.hdf_utils.get_h5_obj_refs(['Guess'], h5_sho_grp_refs)[0]
self.h5_results_grp = self.h5_guess.parent
......
......@@ -63,7 +63,7 @@ h5_f = h5py.File(h5_path, mode='r')
# We can also use the ioHDF5 class from Pycroscopy to open the file. Note that you do need to close the
# file in h5py before opening it again.
h5_f.close()
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
h5_f = hdf.file
# Here, h5_f is an active handle to the open file
......
......@@ -63,7 +63,7 @@ h5_f = h5py.File(h5_path, mode='r')
# We can also use the ioHDF5 class from Pycroscopy to open the file. Note that you do need to close the
# file in h5py before opening it again.
h5_f.close()
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
h5_f = hdf.file
# Here, h5_f is an active handle to the open file
......
......@@ -99,13 +99,13 @@ root_group.show_tree()
h5_path = 'microdata_test.h5'
# Then we use the ioHDF5 class to build the file from our objects.
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
##############################################################################
# The writeData method builds the hdf5 file using the structure defined by the
# MicroData objects. It returns a list of references to all h5py objects in the
# new file.
h5_refs = hdf.writeData(root_group, print_log=True)
h5_refs = hdf.write_data(root_group, print_log=True)
# We can use these references to get the h5py dataset and group objects
h5_main = px.io.hdf_utils.getH5DsetRefs(['Main_Data'], h5_refs)[0]
......
......@@ -182,7 +182,7 @@ Now that we have created the objects, we can write them to an hdf5 file
The writeData method builds the hdf5 file using the structure defined by the
The write_data method builds the hdf5 file using the structure defined by the
MicroData objects. It returns a list of references to all h5py objects in the
new file.
......@@ -190,7 +190,7 @@ new file.
.. code-block:: python
h5_refs = hdf.writeData(root_group, print_log=True)
h5_refs = hdf.write_data(root_group, print_log=True)
# We can use these references to get the h5py dataset and group objects
h5_main = px.io.hdf_utils.get_h5_obj_refs(['Main_Data'], h5_refs)[0]
......
......@@ -147,7 +147,7 @@ h5_path = tran.translate(data_file_path)
# instead.
# opening the file:
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
h5_file = hdf.file
# Visualize the tree structure in the file
......@@ -368,7 +368,7 @@ for at_name in cluster_grp.attrs:
#
# Once the tree is prepared (previous cell), ioHDF5 will handle all the file writing.
h5_clust_refs = hdf.writeData(cluster_grp, print_log=True)
h5_clust_refs = hdf.write_data(cluster_grp, print_log=True)
h5_labels = px.hdf_utils.getH5DsetRefs(['Labels'], h5_clust_refs)[0]
h5_centroids = px.hdf_utils.getH5DsetRefs(['Mean_Response'], h5_clust_refs)[0]
......
......@@ -528,7 +528,7 @@ Once the tree is prepared (previous cell), ioHDF5 will handle all the file writi
.. code-block:: python
h5_clust_refs = hdf.writeData(cluster_grp, print_log=True)
h5_clust_refs = hdf.write_data(cluster_grp, print_log=True)
h5_labels = px.hdf_utils.get_h5_obj_refs(['Labels'], h5_clust_refs)[0]
h5_centroids = px.hdf_utils.get_h5_obj_refs(['Mean_Response'], h5_clust_refs)[0]
......
......@@ -142,7 +142,7 @@ class ShoGuess(px.Process):
sho_grp.add_children([ds_guess, ds_sho_inds, ds_sho_vals])
sho_grp.attrs['SHO_guess_method'] = "pycroscopy BESHO"
h5_sho_grp_refs = self.hdf.writeData(sho_grp)
h5_sho_grp_refs = self.hdf.write_data(sho_grp)
self.h5_guess = px.hdf_utils.getH5DsetRefs(['Guess'], h5_sho_grp_refs)[0]
self.h5_results_grp = self.h5_guess.parent
......
......@@ -160,7 +160,7 @@ Note that:
sho_grp.add_children([ds_guess, ds_sho_inds, ds_sho_vals])
sho_grp.attrs['SHO_guess_method'] = "pycroscopy BESHO"
h5_sho_grp_refs = self.hdf.writeData(sho_grp)
h5_sho_grp_refs = self.hdf.write_data(sho_grp)
self.h5_guess = px.hdf_utils.get_h5_obj_refs(['Guess'], h5_sho_grp_refs)[0]
self.h5_results_grp = self.h5_guess.parent
......
......@@ -82,7 +82,7 @@ data_file_path = 'temp_um.h5'
url = 'https://raw.githubusercontent.com/pycroscopy/pycroscopy/master/data/BELine_0004.h5'
_ = wget.download(url, data_file_path, bar=None)
hdf = px.ioHDF5(data_file_path)
hdf = px.HDFwriter(data_file_path)
h5_file = hdf.file
print('Contents of data file:')
......
......@@ -105,13 +105,13 @@ root_group.show_tree()
h5_path = 'microdata_test.h5'
# Then we use the ioHDF5 class to build the file from our objects.
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
##############################################################################
# The writeData method builds the hdf5 file using the structure defined by the
# MicroData objects. It returns a list of references to all h5py objects in the
# new file.
h5_refs = hdf.writeData(root_group, print_log=True)
h5_refs = hdf.write_data(root_group, print_log=True)
# We can use these references to get the h5py dataset and group objects
h5_main = px.io.hdf_utils.getH5DsetRefs(['Main_Data'], h5_refs)[0]
......
......@@ -146,7 +146,7 @@ h5_path = tran.translate(data_file_path)
# instead.
# opening the file:
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
h5_file = hdf.file
# Visualize the tree structure in the file
......@@ -367,7 +367,7 @@ for at_name in cluster_grp.attrs:
#
# Once the tree is prepared (previous cell), ioHDF5 will handle all the file writing.
h5_clust_refs = hdf.writeData(cluster_grp, print_log=True)
h5_clust_refs = hdf.write_data(cluster_grp, print_log=True)
h5_labels = px.hdf_utils.getH5DsetRefs(['Labels'], h5_clust_refs)[0]
h5_centroids = px.hdf_utils.getH5DsetRefs(['Mean_Response'], h5_clust_refs)[0]
......
......@@ -142,7 +142,7 @@ class ShoGuess(px.Process):
sho_grp.add_children([ds_guess, ds_sho_inds, ds_sho_vals])
sho_grp.attrs['SHO_guess_method'] = "pycroscopy BESHO"
h5_sho_grp_refs = self.hdf.writeData(sho_grp)
h5_sho_grp_refs = self.hdf.write_data(sho_grp)
self.h5_guess = px.hdf_utils.getH5DsetRefs(['Guess'], h5_sho_grp_refs)[0]
self.h5_results_grp = self.h5_guess.parent
......
......@@ -62,7 +62,7 @@ h5_f = h5py.File(h5_path, mode='r')
# We can also use the ioHDF5 class from Pycroscopy to open the file. Note that you do need to close the
# file in h5py before opening it again.
h5_f.close()
hdf = px.ioHDF5(h5_path)
hdf = px.HDFwriter(h5_path)
h5_f = hdf.file
# Here, h5_f is an active handle to the open file
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment