py4dstem / py4DSTEM_tutorials

Sample code for py4DSTEM
GNU General Public License v3.0
36 stars 32 forks source link

Ptycho examples no longer work in v14.9 due to DPC #26

Open erh3cq opened 6 months ago

erh3cq commented 6 months ago

py4DSTEM.process.phase.DPCReconstruction should now be py4DSTEM.process.phase.DPC. I am not sure what notebooks other than ptycho01 and ptycho02 contain this error.

Original notebook:

dpc = py4DSTEM.process.phase.DPCReconstruction(
   datacube=dataset, 
   energy = 300e3,
).preprocess()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[17], line 1
----> 1 dpc = py4DSTEM.process.DPCReconstruction(
      2    datacube=dataset, 
      3    energy = 300e3,
      4 ).preprocess()

AttributeError: module 'py4DSTEM.process' has no attribute 'DPCReconstruction'
gvarnavi commented 6 months ago

Hey @erh3cq,

Thanks for the report! Indeed, py4DSTEM v14.9 includes the latest phase_contrast module refactor which (among many many other things) changed the class names - see here for more info and here for the new class names.

We are collecting some more tutorial data on the new detector this week, and I hope to update all the tutorials notebooks soon thereafter. In the meantime, for your exact issue just remove the Reconstruction part i.e. the class is now simply called DPC.