Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def ortho_hdf(hdf_file, data, attr, configs, parameters):
if hdf_file is not None:
with h5py.File(hdf_file, "a") as hdf:
if "configs" not in hdf.keys():
hdftools.setup_hdf(hdf, data, attr)
hdf.create_dataset("configs", configs.configs.shape)
for k, it in parameters.items():
hdf.create_dataset("wf/" + k, data=it)
hdftools.append_hdf(hdf, data)
hdf["configs"][:, :, :] = configs.configs
for k, it in parameters.items():
hdf["wf/" + k][...] = it.copy()
def opt_hdf(hdf_file, data, attr, configs, parameters):
import pyqmc.hdftools as hdftools
if hdf_file is not None:
with h5py.File(hdf_file, "a") as hdf:
if "configs" not in hdf.keys():
hdftools.setup_hdf(hdf, data, attr)
configs.initialize_hdf(hdf)
hdf.create_group("wf")
for k, it in parameters.items():
hdf.create_dataset("wf/" + k, data=it)
hdftools.append_hdf(hdf, data)
configs.to_hdf(hdf)
for k, it in parameters.items():
hdf["wf/" + k][...] = it.copy()
def dmc_file(hdf_file, data, attr, configs, weights):
import pyqmc.hdftools as hdftools
if hdf_file is not None:
with h5py.File(hdf_file, "a") as hdf:
if "configs" not in hdf.keys():
hdftools.setup_hdf(hdf, data, attr)
configs.initialize_hdf(hdf)
if "weights" not in hdf.keys():
hdf.create_dataset("weights", weights.shape)
hdftools.append_hdf(hdf, data)
configs.to_hdf(hdf)
hdf["weights"][:] = weights
def vmc_file(hdf_file, data, attr, configs):
import pyqmc.hdftools as hdftools
if hdf_file is not None:
with h5py.File(hdf_file, "a") as hdf:
if "configs" not in hdf.keys():
hdftools.setup_hdf(hdf, data, attr)
configs.initialize_hdf(hdf)
hdftools.append_hdf(hdf, data)
configs.to_hdf(hdf)