Getting started with PyDDM: Attribute Error #91
-
Hi I'm an undergraduate just trying to work through the "Diffusing Silica Beads - Simple" walkthrough but I get an error when I try to run ddm_calc.calculate_DDM_matrix(). AttributeError: 'DDM_Analysis' object has no attribute 'ddm_dataset' import matplotlib
import matplotlib.pyplot as plt
import numpy as np #numerical python used for working with arrays, mathematical operations
import xarray as xr #package for labeling and adding metadata to multi-dimensional arrays
import sys
sys.path.append("C:/Users/Toshiba/Documents/PyDDM-0.2.0/PyDDM") #must point to the PyDDM folder
import ddm_analysis_and_fitting as ddm
import yaml
ddm_analysis_parameters_str = """
DataDirectory: 'C:/Users/Toshiba/Documents/PyDDM-0.2.0/dissertation_code/'
FileName: 'images_nobin_40x_128x128_8bit.tif'
Metadata:
pixel_size: 0.242 # size of pixel in um
frame_rate: 41.7 #frames per second
Analysis_parameters:
number_lag_times: 40
last_lag_time: 600
binning: no
Fitting_parameters:
model: 'DDM Matrix - Single Exponential'
Tau: [1.0, 0.001, 10]
StretchingExp: [1.0, 0.5, 1.1]
Amplitude: [1e2, 1, 1e6]
Background: [2.5e4, 0, 1e7]
Good_q_range: [5, 20]
Auto_update_good_q_range: True
"""
parameters_as_dictionary = yaml.safe_load(ddm_analysis_parameters_str)
#ddm_calc = ddm.DDM_Analysis(parameters_as_dictionary)
#The yaml file `example_data_silica_beads.yml` contains the metadata and parameters above
ddm_calc = ddm.DDM_Analysis("C:/Users/Toshiba/Documents/PyDDM-0.2.0/dissertation_code/example_data_silica_beads.yml")
#If a file is found that matches what, by default, the program will save the computed DDM matrix as,
#then you will be prompted as to whether or not you want to proceed with this calculation. If you
#do not, then enter 'n' and the program will read from the existing file to load the DDM dataset
#into memory. If you enter 'y', then the DDM matrix will be calculated.
ddm_calc.calculate_DDM_matrix() Had the same error when doing it through Jupyter Notebook too. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, I managed to fix this. I was using 'numpy' version 1.26.4, where things like 'np.int' and 'np.float' had already been deprecated in 'numpy' 1.2 and were being used in some of the files. Hope this helps anyone else! |
Beta Was this translation helpful? Give feedback.
-
It looks like you have the github for the wrong package. I do not recognise these function names, and the version number found in the directory you have loaded was never released to the public. I'm also not sure what the Silica Beads example is - PyDDM is a package for psychology and cognitive neuroscience. |
Beta Was this translation helpful? Give feedback.
It looks like you have the github for the wrong package. I do not recognise these function names, and the version number found in the directory you have loaded was never released to the public. I'm also not sure what the Silica Beads example is - PyDDM is a package for psychology and cognitive neuroscience.