EasyScience / EasyDiffractionApp

Diffraction data analysis application
https://easydiffraction.org
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Both CrysFML and GSASII calculators failed to work with minimization #120

Closed rozyczko closed 2 years ago

rozyczko commented 2 years ago

Issue 1:

AttributeError: 'Site' object has no attribute 'Uiso'

Issue 2 Additionally, changing a parameter value when CrysFML is chosen gives

'NoneType' object has no attribute 'strip'
rozyczko commented 2 years ago

Both of these issues are now addressed by workarounds: 1: https://github.com/easyScience/easyDiffractionLib/commit/19b97b866781e3564c87ff4b9e03150b99804a35 2: https://github.com/easyScience/easyCore/commit/f7ffdb85d68a5758180ca5a43116738989a680ad

However, these need to be properly understood and fixed.

AndrewSazonov commented 2 years ago

There are no more errors, but the minimisation with CrysFML or GSASII still doesn't work. And it remains broken even after switching back to CrysPy.

rozyczko commented 2 years ago

This has been fixed by implementing a larger numerical differentiation step for CrysFML and GSASII and changing the default method to least_square. This method allows the step to be adjusted. The problem is with the fact that CrysFML uses a 32 bit float to store cell parameters and it runs out of precision when applied the default, very small step by lmfit.

The correct fix is to have CrysFML use double precision values for cell parameters, but we should also be prepared to support calculators which can't be modified.