sas.dataloader module

63 views
Skip to first unread message

Ratel-Ramond Nicolas

unread,
Sep 21, 2023, 10:01:10 AM9/21/23
to diffpy-users
Hi everyone,

I am currently focusing on simultaneous SAXS/WAXS refinement data with a
single model. I have found the nppdfsas.py exmpale in diffpy.srfit
documentation.

However, the code is returning the following error: ModuleNotFoundError:
No module named 'sas.dataloader'

Is there something I missed?
Thanks for your help,

Nicolas


Mikkel Juelsholt

unread,
Sep 21, 2023, 11:58:58 AM9/21/23
to diffpy-users
Hi Nicolas

What version of Diffpy are you using? 

It might be that the SAS module is not updated and only works in 2.7. I would test that

Simon or Pavel might know if the SAS module has been written to Python 3

Cheers Mikkel

Ratel-Ramond Nicolas

unread,
Sep 21, 2023, 12:17:33 PM9/21/23
to diffpy...@googlegroups.com

Thanks for your message. You may be right, this might be a version issue.

I am using diffpy-cmi package, with Python 3.7 (anaconda env). Please let me know if the SAS module has been implemented in Python 3 or if there is an alternative.

Chhers,

Nicolas

--
You received this message because you are subscribed to the Google Groups "diffpy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diffpy-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/diffpy-users/9c6ff586-9544-477e-9f8b-5e1f9546df32n%40googlegroups.com.

Simon Billinge

unread,
Sep 21, 2023, 12:47:55 PM9/21/23
to diffpy...@googlegroups.com
Thanks Mikkel for helping out.

I would have to take a look where the sas code is to know if it is updated or not, but it is a real possibility that it wasn't .

I will take a look

S



--
Simon Billinge
Professor, 
Department of Applied Physics and Applied Mathematics
Columbia University

Simon Billinge

unread,
Sep 21, 2023, 12:55:58 PM9/21/23
to diffpy...@googlegroups.com
Dear Nicolas,

I don't see a call to sas.dataloader.  Please can you send me the full stack dump to help me track it down?

Ratel-Ramond Nicolas

unread,
Sep 21, 2023, 1:54:56 PM9/21/23
to diffpy...@googlegroups.com

Dear Simon,

Thanks for you help. I did not modify the code from the example (except the path to C60.stru file)

Here is the full answer from Python

 Fichier "/home-local/ratel-ra/Documents/Python_code/Diffpy/Diffpy_examples/npsaspdf.py", ligne 185, dans <module>
    recipe = makeRecipe(ciffile, grdata, iqdata)
  Fichier "/home-local/ratel-ra/Documents/Python_code/Diffpy/Diffpy_examples/npsaspdf.py", ligne 71, dans <module>
    sasparser.parseFile(iqdata)
  Fichier "/home-local/ratel-ra/anaconda3_c/envs/py37/lib/python3.7/site-packages/diffpy.srfit-3.0.0-py3.7.egg/diffpy/srfit/sas/sasparser.py", ligne 86, dans parseFile
    Loader = sasimport('sas.dataloader.loader').Loader
  Fichier "/home-local/ratel-ra/anaconda3_c/envs/py37/lib/python3.7/site-packages/diffpy.srfit-3.0.0-py3.7.egg/diffpy/srfit/sas/sasimport.py", ligne 64, dans sasimport
    exec('import %s as mobj' % modname)
  Fichier "<string>", ligne 1, dans <module>
builtins.ModuleNotFoundError: No module named 'sas.dataloader'

Thanks again,

Regards,

Nicolas

Mikkel Juelsholt

unread,
Sep 21, 2023, 2:10:06 PM9/21/23
to diffpy-users
Hi Nicolas 

I quite sure the SAS module works in python 2. So the quick workaround right now is to make a python 2.7 environment and then install the old version of diffpy with the SAS module. I have that installed on a mac, and that worked last time I used it.

Cheers Mikkel

Ratel-Ramond Nicolas

unread,
Sep 21, 2023, 2:20:31 PM9/21/23
to diffpy...@googlegroups.com

ok thanks. I'll have a try and create a python2.7 environment. I'll keep you informed (i 'll do that tomorrow).

Nicolas

Ratel-Ramond Nicolas

unread,
Sep 22, 2023, 5:02:38 AM9/22/23
to diffpy...@googlegroups.com

Hi Mikkel,

I have attempted creating a python 2.7 environment with the suitable diffpy version. However, i get an error message regarding pyobjcryst module, which is unfortunately not available for python 2.7 (still while running the npsas.py example in diffpy documentation).

Thanks in advance,

Nicolas

Mikkel Juelsholt

unread,
Oct 11, 2023, 11:44:49 AM10/11/23
to diffpy-users
Hi Nicolas 

Sorry for the slow reply. I did not see your reply. 

You can use the loadStructure function instead. You need to constrain the lattice parameters a little differently, but there should be examples of how to do it online. 

Cheers Mikkel
Reply all
Reply to author
Forward
0 new messages