Skip to content

Conversation

@wardsimon
Copy link
Member

No description provided.

wardsimon and others added 18 commits July 23, 2021 11:57
As easy as:


```
from easyCore import np
from easyDiffractionLib import Phase
from easyDiffractionLib.Runner import Runner
import matplotlib.pyplot as plt

r = Runner()
p = Phase.from_cif_file('tests/PbSO4.cif')
r.add_job('testing', job_type='powder1dTOF')
r.add_phase(p, 'testing')
job = r.jobs['testing']

job.pattern.zero_shift = 2.9121
job.create_simulation(np.linspace(3000, 11000, 801))
job.plot_simulation()
plt.show()
```
@wardsimon wardsimon merged commit ab2100b into develop Aug 24, 2021
@wardsimon wardsimon added the [scope] enhancement Adds/improves features (major.MINOR.patch) label Oct 4, 2021
rozyczko added a commit that referenced this pull request Feb 3, 2022
* Fixup naming conventions

* Recursive path gen update

* Add debuging 


REmove plot debugging

* Add a Jupyter notebook

* Create devcontainer.json

* Create Dockerfile

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Create Base.Dockerfile

* Create common-debian.sh

* Create python-debian.sh

* Create node-debian.sh

* Change the way phases are managed

* Modify formation of Pattern

* Remove monty

* Update example notebook

* Rename Cryspy -> CrysPy

* Change from cryspy -> CrysPy

* Introduce a fitting example

* Initial implementation of GSAS-II

* Load GSASII from github (macOS only)

* Import GSASII

* Use CFML so_macos branch

* fix branch name

* Update import GSASII

* fix platform call

* Set matplotlib version

* try matplotlib 3.2.2

* Delete poetry.lock

* Refactor gsas

* Make CrysPy default calc

* Read/write temp files from default temp dir

* Use poetry update in CI

* Add libs to dependencies

* Fix import GSAS

* Update init

* Print location of Python dylib

* Try default github python

* Update test.yml

* Update test.yml

* Update test.yml

* Relink CrysFML from default Python dylib

* Update test.yml

* Update test.yml

* Fix path to CFML so

* Update test.yml

* Try on ubuntu

* Fix path to CFML so

* Fix matrix.os name

* Fix path for patchelf

* Try script for relinking crysfml

* Try on ubuntu

* Show some debug info

* Update temp cif printing

* Update __init__.py

* Update test.yml

* New crysfml api

* New cfml api

* Remove old CMFL_api

* Update to gsas

* Update relink cryspy script

* Fix CFML path

* Test CI on macos and ubuntu

* Fix ci script

* Add Point based background logic

* Add zero_shift parameter

* More BG work

* Update background label

* Sorted backgrounds

* Some changes to fix background

* Rename instrument resolution vars

* Add point names

* Point upper/lower

* Scale and x_offset implemented

* Modify background label

* Fix build script

* Fixup build scripts

* Update for specie work

* Recalculate sin(Th)/Lambda

* Set some experimental parameters

* Fixup some serialization

* Keep temp.cif file for fitting process

* Fix sinTh/Lambda for CFML

* Keep temp.cif for fitting with CFML

* Update to new CFML api

* Tidy up background work

* More background tidying

* Revert BG changes

* Debugging info for y_calc

* Add fitting notebook

* More fitting work

* Add CFML fitting notebook

* Update branches

* Update sin(theta)/lambda

* Example bug fixes

* disable ubuntu ci

* Use new CFML api

* Add ubuntu ci

* Make libs repos public

* macOS CI only

* Temporarily disable libs

* Remove poetry.lock

* Try windows CI

* Update RelinkCrysfml

* Add linux and macos to CI

* Install libgfortran4 on ubuntu

* Update CFML jupyter notebook example

* More x-array examples

* Add  setup and requirements for binder

* Move to easyCore develop

* Undo/Redo stack work

* Initial implementation of get_hkl

* Set default hkl arrays empty

* Rename stack_deco to property_stack_deco

* Change cryspy handling

* Merge the interfacing work of Sprint13 (#8)

* Update reflection list generation

* Some changes related to new interface

* self.conditions to job_info

* More changes related to new CFML interface

* Adjust resolution parameters

* Use new_cfml branch of libs

* Bump Cryspy from ^0.4 to ^0.5

* Use develop branch of libsWin32/libsLinux/libsDarwin

* Temporarily fix for bravis_type in cryspy

* Use new CrysFML with Bragg peaks

* First work on new interface

This is a test implementation where only experimental parameters are properly bound in the cryspy engine.
```
from easyDiffractionLib.interface import InterfaceFactory
from easyDiffractionLib.Elements.Experiments.Experiment import Pars1D
p = Pars1D.default()
i = InterfaceFactory()
p.interface = i
p.generate_bindings()
p.resolution_u = 0.2
```

* More interfacing

Continuing the cryspy interface with more details

* More interfacing work

* More interfacing work

* Atom linking via ID

* Hack to interface

* Update fileless cryspy

* File based CFML interface

* File based GSAS2 interface

* Fix BG issues with file based calculators

* Fix a mistake (removal of phases)

* Fix linking error (cryspy resolution and setup)

* Reduce BG and HKL (CrysFML) computation time

* Add matplotlib for cryspy

* Fix for cryspy spacegroups (kinda) and GSAS peak HKL indexes

* Modify MonkeyPatching of Phases

The monkey patch of `Phases` to support the appending of interfaces was referencing the wrong append fn, hence the proper interfacing was not established.
Modification of the sample, now when you do `obj.phases = phase` the phase is appended and `obj.phases = new_phases` overwrites the `obj.phases` field. sw

* Fix Point BG evaluation when zero points

Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>

* Use 'develop' branch of easyCore

* Update pyproject.toml

* Update pyproject.toml

* Update __init__.py

* Update test.yml

* Update pyproject.toml

* Update GSASII.py

* ReflectionList nrefs to nref

* Moving to a more module based scheme

* TOF support

As easy as:


```
from easyCore import np
from easyDiffractionLib import Phase
from easyDiffractionLib.Runner import Runner
import matplotlib.pyplot as plt

r = Runner()
p = Phase.from_cif_file('tests/PbSO4.cif')
r.add_job('testing', job_type='powder1dTOF')
r.add_phase(p, 'testing')
job = r.jobs['testing']

job.pattern.zero_shift = 2.9121
job.create_simulation(np.linspace(3000, 11000, 801))
job.plot_simulation()
plt.show()
```

* Decouple phases and EXP in cryspy

* Fix legacy mode loading

* Use the correct references for legacy mode

* Unification of naming conventions

* Fix TOF generation

* Fix changing from TOF->CW

* Fix  all interfaces to use new schema

* Update interface and exp_type verification logic

* cryspy multiprocess support

* Change mp pool methodology

* Add scaling parameters for phases

* Initial Polarization work

* Work on obtaining HKL

* Fix get HKL

* Update requirements

* Add TOF calculation for cryspy (#10)

* Update pyproject.toml

* Update __init__.py

* Update test.yml

* Update pyproject.toml

* Update GSASII.py

* ReflectionList nrefs to nref

* Moving to a more module based scheme

* TOF support

As easy as:


```
from easyCore import np
from easyDiffractionLib import Phase
from easyDiffractionLib.Runner import Runner
import matplotlib.pyplot as plt

r = Runner()
p = Phase.from_cif_file('tests/PbSO4.cif')
r.add_job('testing', job_type='powder1dTOF')
r.add_phase(p, 'testing')
job = r.jobs['testing']

job.pattern.zero_shift = 2.9121
job.create_simulation(np.linspace(3000, 11000, 801))
job.plot_simulation()
plt.show()
```

* Decouple phases and EXP in cryspy

* Fix legacy mode loading

* Use the correct references for legacy mode

* Unification of naming conventions

* Fix TOF generation

* Fix changing from TOF->CW

* Fix  all interfaces to use new schema

* Update interface and exp_type verification logic

* Fix get HKL

* Update requirements

Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>

* Delete .devcontainer directory

* Delete tools directory

* Tests base and README

* Update LICENSE

* fixed/updated FittingData notebook

* more updates for new eC and eDL

* Disable Lorentzian coefficients

* Added CreateSample notebook, added structure show to existing notebooks.

* Cleaned up outputs

* Temporary workaround to get ADP value

* easyCore dependence temporarily changed

* Minor changes to the notebooks. Updated toml and fixed CFML interface

* Separated working notebooks to a different directory.

* Temporary workaround to get ADP value (GSASII)

* Fix return value; back to develop branch

* Add PbSO4 fitting notebook

* Updated notebooks, corrected dependency for easyCore

* Auto stash before merge of "more_notebooks" and "origin/more_notebooks"

* Disable debug output for CFML

* Use easyCore from the develop branch

* Update fitting notebook

* Move notebooks into 'examples' folder

* Add instruction on how to run Jupyter Notebook examples

* Update fitting example

* A bit better README

* Add contributing details

* Start with tests

* Delete setup.py

* Update README.md

* Update both `simulation` and `fitting` examples

* Update README.md

* Delete unused files

* Added modified fix from the mp_mc branch to enable proper phase removal
and profile calculation on experiment type change

* Update both `simulation` and `fitting` examples

* Fix up Docs and files

* Update badge

* Add generators

* Update self_publish_alpha.yml

* Auto stash before merge of "develop" and "origin/develop"

* Update self_publish_alpha.yml

* Update generate_html.py

* Update self_publish_alpha.yml

* Update self_publish_alpha.yml

* Update self_publish_alpha.yml

* Auto stash before merge of "develop" and "origin/develop"

* Update self_publish_alpha.yml

* Try to create tagged realease

* Rename from easyDiffractionLib to easyDiffraction

* Modify project and requirements

* Use easysciencecore >= 0.1.1a0

* Only push if changes

* Add `v` to tag

* Update README.md

* Write all packages

* Add PR validation (needs labels)

* Add more branch protection stuff

* Add documentation label

* Add the ability to launch examples on Binder (#12)

* Create binder scripts

* Remove unnecessary jupyter

* Explicit external libs

* Add correct path when using binder

* Update readme [ci skip]

* Switch from `matplotlib` to `bokeh` in notebooks

* Update requirements to use `bokeh` instead of `matplotlib`

* Add links to non-interactive preview for notebooks

* Fix import `easyDiffractionLib`

* Update notebooks

* Update notebook

* Update postBuild

* Update Simulation.ipynb

* Update notebooks

* Add patch to autobuild (fix pypi arguments)

* Create pypi_publish.yml

* Modified mp_mc branch with pathos multiprocessing commented out

* Added convencience methods for single phase profiles

* Redefine additional_data['components'] with scaled values

* typo in toml

* Implement multiphase with CFML

* More CFML multiphase changes

Now phases are in the correct order and no memloc errors

* Fix memory issues again

* Fix spacegroup errors for multiphase

* Add support for the multiple HKL sets

* x_array is unnecessary for cryspy - hkl has already been calculated in
the profile run

* Fix for getting HKL's

* Use easyCrystallography

* Added a multiphase fitting example

* fix a "typo".

* fixed method signatures.

* Update requirements

* Test pre-release branch of easyCore

* Updated copyright year

* Try to use the release version of easyCore

Co-authored-by: Simon Ward <2798086+wardsimon@users.noreply.github.com>
Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>
Co-authored-by: Andrew Sazonov <Andrew.Sazonov@icloud.com>
rozyczko added a commit that referenced this pull request Jul 26, 2022
* Update background label

* Sorted backgrounds

* Some changes to fix background

* Rename instrument resolution vars

* Add point names

* Point upper/lower

* Scale and x_offset implemented

* Modify background label

* Fix build script

* Fixup build scripts

* Update for specie work

* Recalculate sin(Th)/Lambda

* Set some experimental parameters

* Fixup some serialization

* Keep temp.cif file for fitting process

* Fix sinTh/Lambda for CFML

* Keep temp.cif for fitting with CFML

* Update to new CFML api

* Tidy up background work

* More background tidying

* Revert BG changes

* Debugging info for y_calc

* Add fitting notebook

* More fitting work

* Add CFML fitting notebook

* Update branches

* Update sin(theta)/lambda

* Example bug fixes

* disable ubuntu ci

* Use new CFML api

* Add ubuntu ci

* Make libs repos public

* macOS CI only

* Temporarily disable libs

* Remove poetry.lock

* Try windows CI

* Update RelinkCrysfml

* Add linux and macos to CI

* Install libgfortran4 on ubuntu

* Update CFML jupyter notebook example

* More x-array examples

* Add  setup and requirements for binder

* Move to easyCore develop

* Undo/Redo stack work

* Initial implementation of get_hkl

* Set default hkl arrays empty

* Rename stack_deco to property_stack_deco

* Change cryspy handling

* Merge the interfacing work of Sprint13 (#8)

* Update reflection list generation

* Some changes related to new interface

* self.conditions to job_info

* More changes related to new CFML interface

* Adjust resolution parameters

* Use new_cfml branch of libs

* Bump Cryspy from ^0.4 to ^0.5

* Use develop branch of libsWin32/libsLinux/libsDarwin

* Temporarily fix for bravis_type in cryspy

* Use new CrysFML with Bragg peaks

* First work on new interface

This is a test implementation where only experimental parameters are properly bound in the cryspy engine.
```
from easyDiffractionLib.interface import InterfaceFactory
from easyDiffractionLib.Elements.Experiments.Experiment import Pars1D
p = Pars1D.default()
i = InterfaceFactory()
p.interface = i
p.generate_bindings()
p.resolution_u = 0.2
```

* More interfacing

Continuing the cryspy interface with more details

* More interfacing work

* More interfacing work

* Atom linking via ID

* Hack to interface

* Update fileless cryspy

* File based CFML interface

* File based GSAS2 interface

* Fix BG issues with file based calculators

* Fix a mistake (removal of phases)

* Fix linking error (cryspy resolution and setup)

* Reduce BG and HKL (CrysFML) computation time

* Add matplotlib for cryspy

* Fix for cryspy spacegroups (kinda) and GSAS peak HKL indexes

* Modify MonkeyPatching of Phases

The monkey patch of `Phases` to support the appending of interfaces was referencing the wrong append fn, hence the proper interfacing was not established.
Modification of the sample, now when you do `obj.phases = phase` the phase is appended and `obj.phases = new_phases` overwrites the `obj.phases` field. sw

* Fix Point BG evaluation when zero points

Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>

* Use 'develop' branch of easyCore

* Update pyproject.toml

* Update pyproject.toml

* Update __init__.py

* Update test.yml

* Update pyproject.toml

* Update GSASII.py

* ReflectionList nrefs to nref

* Moving to a more module based scheme

* TOF support

As easy as:


```
from easyCore import np
from easyDiffractionLib import Phase
from easyDiffractionLib.Runner import Runner
import matplotlib.pyplot as plt

r = Runner()
p = Phase.from_cif_file('tests/PbSO4.cif')
r.add_job('testing', job_type='powder1dTOF')
r.add_phase(p, 'testing')
job = r.jobs['testing']

job.pattern.zero_shift = 2.9121
job.create_simulation(np.linspace(3000, 11000, 801))
job.plot_simulation()
plt.show()
```

* Decouple phases and EXP in cryspy

* Fix legacy mode loading

* Use the correct references for legacy mode

* Unification of naming conventions

* Fix TOF generation

* Fix changing from TOF->CW

* Fix  all interfaces to use new schema

* Update interface and exp_type verification logic

* cryspy multiprocess support

* Change mp pool methodology

* Add scaling parameters for phases

* Initial Polarization work

* Work on obtaining HKL

* Fix get HKL

* Update requirements

* Add TOF calculation for cryspy (#10)

* Update pyproject.toml

* Update __init__.py

* Update test.yml

* Update pyproject.toml

* Update GSASII.py

* ReflectionList nrefs to nref

* Moving to a more module based scheme

* TOF support

As easy as:


```
from easyCore import np
from easyDiffractionLib import Phase
from easyDiffractionLib.Runner import Runner
import matplotlib.pyplot as plt

r = Runner()
p = Phase.from_cif_file('tests/PbSO4.cif')
r.add_job('testing', job_type='powder1dTOF')
r.add_phase(p, 'testing')
job = r.jobs['testing']

job.pattern.zero_shift = 2.9121
job.create_simulation(np.linspace(3000, 11000, 801))
job.plot_simulation()
plt.show()
```

* Decouple phases and EXP in cryspy

* Fix legacy mode loading

* Use the correct references for legacy mode

* Unification of naming conventions

* Fix TOF generation

* Fix changing from TOF->CW

* Fix  all interfaces to use new schema

* Update interface and exp_type verification logic

* Fix get HKL

* Update requirements

Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>

* Delete .devcontainer directory

* Delete tools directory

* Tests base and README

* Update LICENSE

* fixed/updated FittingData notebook

* more updates for new eC and eDL

* Disable Lorentzian coefficients

* Added CreateSample notebook, added structure show to existing notebooks.

* Cleaned up outputs

* Temporary workaround to get ADP value

* easyCore dependence temporarily changed

* Minor changes to the notebooks. Updated toml and fixed CFML interface

* Separated working notebooks to a different directory.

* Temporary workaround to get ADP value (GSASII)

* Fix return value; back to develop branch

* Add PbSO4 fitting notebook

* Updated notebooks, corrected dependency for easyCore

* Auto stash before merge of "more_notebooks" and "origin/more_notebooks"

* Disable debug output for CFML

* Use easyCore from the develop branch

* Update fitting notebook

* Move notebooks into 'examples' folder

* Add instruction on how to run Jupyter Notebook examples

* Update fitting example

* A bit better README

* Add contributing details

* Start with tests

* Delete setup.py

* Update README.md

* Update both `simulation` and `fitting` examples

* Update README.md

* Delete unused files

* Added modified fix from the mp_mc branch to enable proper phase removal
and profile calculation on experiment type change

* Update both `simulation` and `fitting` examples

* Fix up Docs and files

* Update badge

* Add generators

* Update self_publish_alpha.yml

* Auto stash before merge of "develop" and "origin/develop"

* Update self_publish_alpha.yml

* Update generate_html.py

* Update self_publish_alpha.yml

* Update self_publish_alpha.yml

* Update self_publish_alpha.yml

* Auto stash before merge of "develop" and "origin/develop"

* Update self_publish_alpha.yml

* Try to create tagged realease

* Rename from easyDiffractionLib to easyDiffraction

* Modify project and requirements

* Use easysciencecore >= 0.1.1a0

* Only push if changes

* Add `v` to tag

* Update README.md

* Write all packages

* Add PR validation (needs labels)

* Add more branch protection stuff

* Add documentation label

* Add the ability to launch examples on Binder (#12)

* Create binder scripts

* Remove unnecessary jupyter

* Explicit external libs

* Add correct path when using binder

* Update readme [ci skip]

* Switch from `matplotlib` to `bokeh` in notebooks

* Update requirements to use `bokeh` instead of `matplotlib`

* Add links to non-interactive preview for notebooks

* Fix import `easyDiffractionLib`

* Update notebooks

* Update notebook

* Update postBuild

* Update Simulation.ipynb

* Update notebooks

* Add patch to autobuild (fix pypi arguments)

* Create pypi_publish.yml

* Modified mp_mc branch with pathos multiprocessing commented out

* Added convencience methods for single phase profiles

* Redefine additional_data['components'] with scaled values

* typo in toml

* Implement multiphase with CFML

* More CFML multiphase changes

Now phases are in the correct order and no memloc errors

* Fix memory issues again

* Fix spacegroup errors for multiphase

* Add support for the multiple HKL sets

* x_array is unnecessary for cryspy - hkl has already been calculated in
the profile run

* Fix for getting HKL's

* Use easyCrystallography

* Added a multiphase fitting example

* fix a "typo".

* fixed method signatures.

* Update requirements

* Test pre-release branch of easyCore

* Updated copyright year

* Try to use the release version of easyCore

* update poetry
force rebuild for testing easyCrystallography branch

* Fetch easyCrystallography from pypi

* Remove multiphase temp files on CFML calculator initialize #190 (#36)

* Update pytest requirement from ^5.2 to ^7.1 (#37)

Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@5.2.0...7.1.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pyproject.toml (#38)

Change classifier to reflect BSD

* added polarization and efficiency to instrument parameters

* More polarization work and re-write of interface

* Cryspy V2

* removed some old polarized code from ToF
fixed strings in experiment type assignment

* More v2 work

* Touch up polarisation class

* Cleanup and refactor

* Fix site generation

* Corrected branch name for the crystallography module

* More work on cryspyV2

* Add magnetic Susceptibility to the`Site`

* Add Magnetic Susceptibility to calculator and cryspy interfaces

* added polarized structure/experiment files

* Update to use correct modules

* Update imports

* More V2 update work

* Fixed adding adps to kwargs

* added msp support

* Structure load fixes after changes in core

* Number of fixes/extensions to allow polarized calculations.
Added a simple script for polarized case

* Minor fixes for the app functionality

* Moved fit_func to derived class so it can be properly referenced.
Added remove_phase and add_phase to the V2 calculator

* Enable refinement options to be passed to the calculator.

* Fixed refinement cases

* Enabling beam polarization setup

* Make Ciso default

* Fix loading multiphase project files

* Added attribute to tell default msp from read in actual values

* it_coordinate_system_code in cryspy spacegroup

* MSP connection fix

* Move cif module

* Minor fix to adding components

* Fix order of the magnetic susceptibilities

* MSP optional for site

* Fix unpol -> pol switching on cryspyV2

* More pol work

* Add magnetic field option

* Temporarily remove normalisation

* Added get_component getter for retrieving more information from
additional_data in calculators

* Update returned up/down profiles to match total

* Ci fix (#45)

* Try with >=3.8

* remove 3.7 in more places

* One more occurence

* Update pyproject.toml

* Update requirements.txt

* Add methods to V2

* Have the CFML and GSAS interfaces understand extended feature string

* Disabled cryspyV2 interface for the time being

* Fix get hkl for CrysFML calculator

* Auto stash before merge of "polarizedV2" and "origin/release-0.8.4"

* Added missing methods for GSAS.

* Removed file deletion. It messes up with fitting on Windows and the
files get removed anyway at the interface level.

* Added polarized notebook example.

* Use develop branch of easyCrystallography (with undo/redo fix)

* Added a conveience method

* version change 0.0.3 -> 0.0.4

* switch to master on crystallography
bump release number

Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>
Co-authored-by: Simon Ward <2798086+wardsimon@users.noreply.github.com>
Co-authored-by: Andrew Sazonov <Andrew.Sazonov@icloud.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew McCluskey <andrew@mccluskey.scot>
Co-authored-by: Andrew Sazonov <andrew.sazonov@esss.eu>
rozyczko added a commit that referenced this pull request Mar 28, 2023
* Modify background label

* Fix build script

* Fixup build scripts

* Update for specie work

* Recalculate sin(Th)/Lambda

* Set some experimental parameters

* Fixup some serialization

* Keep temp.cif file for fitting process

* Fix sinTh/Lambda for CFML

* Keep temp.cif for fitting with CFML

* Update to new CFML api

* Tidy up background work

* More background tidying

* Revert BG changes

* Debugging info for y_calc

* Add fitting notebook

* More fitting work

* Add CFML fitting notebook

* Update branches

* Update sin(theta)/lambda

* Example bug fixes

* disable ubuntu ci

* Use new CFML api

* Add ubuntu ci

* Make libs repos public

* macOS CI only

* Temporarily disable libs

* Remove poetry.lock

* Try windows CI

* Update RelinkCrysfml

* Add linux and macos to CI

* Install libgfortran4 on ubuntu

* Update CFML jupyter notebook example

* More x-array examples

* Add  setup and requirements for binder

* Move to easyCore develop

* Undo/Redo stack work

* Initial implementation of get_hkl

* Set default hkl arrays empty

* Rename stack_deco to property_stack_deco

* Change cryspy handling

* Merge the interfacing work of Sprint13 (#8)

* Update reflection list generation

* Some changes related to new interface

* self.conditions to job_info

* More changes related to new CFML interface

* Adjust resolution parameters

* Use new_cfml branch of libs

* Bump Cryspy from ^0.4 to ^0.5

* Use develop branch of libsWin32/libsLinux/libsDarwin

* Temporarily fix for bravis_type in cryspy

* Use new CrysFML with Bragg peaks

* First work on new interface

This is a test implementation where only experimental parameters are properly bound in the cryspy engine.
```
from easyDiffractionLib.interface import InterfaceFactory
from easyDiffractionLib.Elements.Experiments.Experiment import Pars1D
p = Pars1D.default()
i = InterfaceFactory()
p.interface = i
p.generate_bindings()
p.resolution_u = 0.2
```

* More interfacing

Continuing the cryspy interface with more details

* More interfacing work

* More interfacing work

* Atom linking via ID

* Hack to interface

* Update fileless cryspy

* File based CFML interface

* File based GSAS2 interface

* Fix BG issues with file based calculators

* Fix a mistake (removal of phases)

* Fix linking error (cryspy resolution and setup)

* Reduce BG and HKL (CrysFML) computation time

* Add matplotlib for cryspy

* Fix for cryspy spacegroups (kinda) and GSAS peak HKL indexes

* Modify MonkeyPatching of Phases

The monkey patch of `Phases` to support the appending of interfaces was referencing the wrong append fn, hence the proper interfacing was not established.
Modification of the sample, now when you do `obj.phases = phase` the phase is appended and `obj.phases = new_phases` overwrites the `obj.phases` field. sw

* Fix Point BG evaluation when zero points

Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>

* Use 'develop' branch of easyCore

* Update pyproject.toml

* Update pyproject.toml

* Update __init__.py

* Update test.yml

* Update pyproject.toml

* Update GSASII.py

* ReflectionList nrefs to nref

* Moving to a more module based scheme

* TOF support

As easy as:


```
from easyCore import np
from easyDiffractionLib import Phase
from easyDiffractionLib.Runner import Runner
import matplotlib.pyplot as plt

r = Runner()
p = Phase.from_cif_file('tests/PbSO4.cif')
r.add_job('testing', job_type='powder1dTOF')
r.add_phase(p, 'testing')
job = r.jobs['testing']

job.pattern.zero_shift = 2.9121
job.create_simulation(np.linspace(3000, 11000, 801))
job.plot_simulation()
plt.show()
```

* Decouple phases and EXP in cryspy

* Fix legacy mode loading

* Use the correct references for legacy mode

* Unification of naming conventions

* Fix TOF generation

* Fix changing from TOF->CW

* Fix  all interfaces to use new schema

* Update interface and exp_type verification logic

* cryspy multiprocess support

* Change mp pool methodology

* Add scaling parameters for phases

* Initial Polarization work

* Work on obtaining HKL

* Fix get HKL

* Update requirements

* Add TOF calculation for cryspy (#10)

* Update pyproject.toml

* Update __init__.py

* Update test.yml

* Update pyproject.toml

* Update GSASII.py

* ReflectionList nrefs to nref

* Moving to a more module based scheme

* TOF support

As easy as:


```
from easyCore import np
from easyDiffractionLib import Phase
from easyDiffractionLib.Runner import Runner
import matplotlib.pyplot as plt

r = Runner()
p = Phase.from_cif_file('tests/PbSO4.cif')
r.add_job('testing', job_type='powder1dTOF')
r.add_phase(p, 'testing')
job = r.jobs['testing']

job.pattern.zero_shift = 2.9121
job.create_simulation(np.linspace(3000, 11000, 801))
job.plot_simulation()
plt.show()
```

* Decouple phases and EXP in cryspy

* Fix legacy mode loading

* Use the correct references for legacy mode

* Unification of naming conventions

* Fix TOF generation

* Fix changing from TOF->CW

* Fix  all interfaces to use new schema

* Update interface and exp_type verification logic

* Fix get HKL

* Update requirements

Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>

* Delete .devcontainer directory

* Delete tools directory

* Tests base and README

* Update LICENSE

* fixed/updated FittingData notebook

* more updates for new eC and eDL

* Disable Lorentzian coefficients

* Added CreateSample notebook, added structure show to existing notebooks.

* Cleaned up outputs

* Temporary workaround to get ADP value

* easyCore dependence temporarily changed

* Minor changes to the notebooks. Updated toml and fixed CFML interface

* Separated working notebooks to a different directory.

* Temporary workaround to get ADP value (GSASII)

* Fix return value; back to develop branch

* Add PbSO4 fitting notebook

* Updated notebooks, corrected dependency for easyCore

* Auto stash before merge of "more_notebooks" and "origin/more_notebooks"

* Disable debug output for CFML

* Use easyCore from the develop branch

* Update fitting notebook

* Move notebooks into 'examples' folder

* Add instruction on how to run Jupyter Notebook examples

* Update fitting example

* A bit better README

* Add contributing details

* Start with tests

* Delete setup.py

* Update README.md

* Update both `simulation` and `fitting` examples

* Update README.md

* Delete unused files

* Added modified fix from the mp_mc branch to enable proper phase removal
and profile calculation on experiment type change

* Update both `simulation` and `fitting` examples

* Fix up Docs and files

* Update badge

* Add generators

* Update self_publish_alpha.yml

* Auto stash before merge of "develop" and "origin/develop"

* Update self_publish_alpha.yml

* Update generate_html.py

* Update self_publish_alpha.yml

* Update self_publish_alpha.yml

* Update self_publish_alpha.yml

* Auto stash before merge of "develop" and "origin/develop"

* Update self_publish_alpha.yml

* Try to create tagged realease

* Rename from easyDiffractionLib to easyDiffraction

* Modify project and requirements

* Use easysciencecore >= 0.1.1a0

* Only push if changes

* Add `v` to tag

* Update README.md

* Write all packages

* Add PR validation (needs labels)

* Add more branch protection stuff

* Add documentation label

* Add the ability to launch examples on Binder (#12)

* Create binder scripts

* Remove unnecessary jupyter

* Explicit external libs

* Add correct path when using binder

* Update readme [ci skip]

* Switch from `matplotlib` to `bokeh` in notebooks

* Update requirements to use `bokeh` instead of `matplotlib`

* Add links to non-interactive preview for notebooks

* Fix import `easyDiffractionLib`

* Update notebooks

* Update notebook

* Update postBuild

* Update Simulation.ipynb

* Update notebooks

* Add patch to autobuild (fix pypi arguments)

* Create pypi_publish.yml

* Modified mp_mc branch with pathos multiprocessing commented out

* Added convencience methods for single phase profiles

* Redefine additional_data['components'] with scaled values

* typo in toml

* Implement multiphase with CFML

* More CFML multiphase changes

Now phases are in the correct order and no memloc errors

* Fix memory issues again

* Fix spacegroup errors for multiphase

* Add support for the multiple HKL sets

* x_array is unnecessary for cryspy - hkl has already been calculated in
the profile run

* Fix for getting HKL's

* Use easyCrystallography

* Added a multiphase fitting example

* fix a "typo".

* fixed method signatures.

* Update requirements

* Test pre-release branch of easyCore

* Updated copyright year

* Try to use the release version of easyCore

* update poetry
force rebuild for testing easyCrystallography branch

* Fetch easyCrystallography from pypi

* Remove multiphase temp files on CFML calculator initialize #190 (#36)

* Update pytest requirement from ^5.2 to ^7.1 (#37)

Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@5.2.0...7.1.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pyproject.toml (#38)

Change classifier to reflect BSD

* Updated pypi-publish step (#55)

* Implement peak asymmetries for CrysPy P1D (#57)

Co-authored-by: Andrew Sazonov <andrew.sazonov@esss.eu>

* Experiment cif reader (#58)

* Initial implementation. Things break.

* prettify the code

* Get the job object directly on reading the exp file

* cherrypicked remaining changes from IOTake2.

* More fixes

* Update from_cif_file signature. Added case for xml-fied phase

* Added a crutch for updating the background dict repr with the linked
experiment item

* Switch to pre-release-fixes branch of Core

* Bump cfml from 0.0.1 to 0.0.3 (#44)

Bumps [cfml]() from 0.0.1 to 0.0.3.

---
updated-dependencies:
- dependency-name: cfml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Temporarily lock easyCore version after API breaking changes in 0.3.0.
This will be removed on merging of IOTake3

* Update bokeh requirement from ^2.4.0 to ^3.0.3 (#65)

Updates the requirements on [bokeh](https://github.com/bokeh/bokeh) to permit the latest version.
- [Release notes](https://github.com/bokeh/bokeh/releases)
- [Changelog](https://github.com/bokeh/bokeh/blob/3.0.3/docs/CHANGELOG)
- [Commits](bokeh/bokeh@2.4.0...3.0.3)

---
updated-dependencies:
- dependency-name: bokeh
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Corrected space group key

* initial version of the pdffit interface. Works for profile calculations.
Loads cif files and pdffit-specific .gr files with experimental PDF

* Added diffpy module dependencies

* point to released version of core and cryst

* Add fitting example, fixed minor issues

* initial version, not much here yet

* move bindings update from sample to job

* return ndarray rather that xarray from fitting
start improving serialization

* Fixes for serialization of the job object

* set default linked experiment for serialized no-exp loaded cases

* Invoke bindings change properly

* Added notebooks for profile calc and fitting

* Bump cfml from 0.0.1 to 0.0.3 (#67)

Bumps [cfml]() from 0.0.1 to 0.0.3.

---
updated-dependencies:
- dependency-name: cfml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Try getting pdffit2 from local pypi

* attempt at fixing dependencies

* Updates from job_based branch.

* make pdffit2 dependency optional, as gsas/cfml

* Updated/fixed pdf interface, now conforming to the job based runs.
Updated python scripts

* Silence the diffpy backend STDOUT

* branch update

* Updated notebooks

* Update py3dmol requirement from ^1.7.0 to ^2.0.1 (#69)

Updates the requirements on [py3dmol](https://3dmol.org) to permit the latest version.

---
updated-dependencies:
- dependency-name: py3dmol
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* dep update

* added delta1, delta2 parameters
apply scale properly
apply Uiso values properly
modify initial parameters for fitting example so it converges nicely

* Prettified the notebook and the script

* Rename CrysPyV2 -> CrysPy
Remove GSASII dependency. It will be made delayed import later

* Update pyproject.toml

* phase without exp - sim range param update causes errors
CFML output parsing fails on certain systems

* debug weird update issue

* Workaround for resized coords

* Add pdffit dependency so pip install doesn't complain

* update requirements.txt

* Minor updates. Moved xarray checks to app.
bumped release number
added contributor

* Make sure interface bindings are properly set on job instantiation

* pdf changes after Celine's comments

* add dependency on pycifrw, required by pdffit2

* delta1 and delta2 have units

* parameter name should be prettyfied

* check if setting pip config helps with module installation

* Modify wavelength to correspond to the gr input file.
Add unit to Q_damp

* notebook and example script updates

* Added "spdiameter" parameter, as per GSASII examples

* added spdiameter parameter to the notebook examples

* update initial values for spdiameter and update the examples

* don't update atoms without adp

* workaround for CFML failures

* Bumped release version
Commented out GSAS in toml/requirements
Try linking pypi versions of EX and EC

* Updated notebooks and added missed method in CryspyV2 interface

* Added minor updates about the current release

* Do not patch the version but take it directly from poetry

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>
Co-authored-by: Simon Ward <2798086+wardsimon@users.noreply.github.com>
Co-authored-by: Andrew Sazonov <Andrew.Sazonov@icloud.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew McCluskey <andrew@mccluskey.scot>
Co-authored-by: Andrew Sazonov <andrew.sazonov@esss.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants