Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
342 commits
Select commit Hold shift + click to select a range
f3e535d
Update background label
AndrewSazonov Nov 16, 2020
c22dd18
Sorted backgrounds
wardsimon Nov 16, 2020
a413ae8
Some changes to fix background
AndrewSazonov Nov 16, 2020
b2da345
Rename instrument resolution vars
AndrewSazonov Nov 16, 2020
1869143
Add point names
wardsimon Nov 16, 2020
40ee09f
Point upper/lower
wardsimon Nov 16, 2020
e0943f7
Scale and x_offset implemented
wardsimon Nov 16, 2020
58c2cb8
Modify background label
AndrewSazonov Nov 17, 2020
cec38ed
Fix build script
AndrewSazonov Nov 17, 2020
8590fa6
Fixup build scripts
wardsimon Nov 17, 2020
0a98055
Merge remote-tracking branch 'origin/gsas' into gsas
wardsimon Nov 17, 2020
85e3c70
Update for specie work
wardsimon Nov 17, 2020
3ce84de
Recalculate sin(Th)/Lambda
AndrewSazonov Nov 17, 2020
8f07686
Set some experimental parameters
AndrewSazonov Nov 18, 2020
721d300
Fixup some serialization
wardsimon Nov 18, 2020
7f3b9ca
Keep temp.cif file for fitting process
AndrewSazonov Nov 19, 2020
44d6463
Fix sinTh/Lambda for CFML
AndrewSazonov Nov 19, 2020
c2108ed
Keep temp.cif for fitting with CFML
AndrewSazonov Nov 19, 2020
710aba3
Update to new CFML api
AndrewSazonov Nov 20, 2020
efb0372
Tidy up background work
wardsimon Nov 25, 2020
d47bfe9
More background tidying
wardsimon Nov 26, 2020
f12e168
Revert BG changes
wardsimon Nov 26, 2020
8713633
Debugging info for y_calc
AndrewSazonov Nov 26, 2020
77bff2e
Add fitting notebook
wardsimon Nov 27, 2020
e4474af
More fitting work
wardsimon Nov 27, 2020
40de2f0
Add CFML fitting notebook
AndrewSazonov Nov 27, 2020
13ec3f5
Update branches
wardsimon Dec 4, 2020
85802ee
Merge pull request #1 from easyScience/coreSiteWork
wardsimon Dec 4, 2020
3dc75a5
Update sin(theta)/lambda
AndrewSazonov Dec 18, 2020
fda4b28
Example bug fixes
wardsimon Jan 8, 2021
95e4647
disable ubuntu ci
AndrewSazonov Jan 8, 2021
4c44a73
Use new CFML api
AndrewSazonov Jan 11, 2021
5d9e092
Add ubuntu ci
AndrewSazonov Jan 11, 2021
a487203
Make libs repos public
AndrewSazonov Jan 12, 2021
8817888
macOS CI only
AndrewSazonov Jan 12, 2021
8b16852
Temporarily disable libs
AndrewSazonov Jan 12, 2021
830a83e
Remove poetry.lock
AndrewSazonov Jan 12, 2021
e97a552
Try windows CI
AndrewSazonov Jan 12, 2021
877466e
Update RelinkCrysfml
AndrewSazonov Jan 12, 2021
bc82b46
Add linux and macos to CI
AndrewSazonov Jan 12, 2021
3f600ec
Install libgfortran4 on ubuntu
AndrewSazonov Jan 13, 2021
34377f9
Update CFML jupyter notebook example
AndrewSazonov Feb 4, 2021
99113cb
More x-array examples
wardsimon Feb 8, 2021
dfcca61
Add setup and requirements for binder
wardsimon Feb 8, 2021
0b482da
Move to easyCore develop
wardsimon Mar 1, 2021
ba1dd0a
Undo/Redo stack work
wardsimon Mar 2, 2021
75c7095
Initial implementation of get_hkl
AndrewSazonov Mar 12, 2021
3a6a7b7
Set default hkl arrays empty
AndrewSazonov Mar 12, 2021
fca17c7
Rename stack_deco to property_stack_deco
AndrewSazonov Mar 12, 2021
ad70df7
Change cryspy handling
wardsimon Mar 26, 2021
e5b82b7
Merge the interfacing work of Sprint13 (#8)
wardsimon Jun 7, 2021
903cd38
Use 'develop' branch of easyCore
AndrewSazonov Jun 8, 2021
2b12aec
Update pyproject.toml
wardsimon Jun 16, 2021
d2cd6aa
Update pyproject.toml
wardsimon Jul 23, 2021
3300b0d
Update __init__.py
wardsimon Jul 23, 2021
7b0fdc0
Update test.yml
wardsimon Jul 23, 2021
bd53c9b
Update pyproject.toml
wardsimon Jul 26, 2021
479a620
Update GSASII.py
wardsimon Jul 26, 2021
2fd6510
ReflectionList nrefs to nref
AndrewSazonov Jul 27, 2021
4cdd194
Moving to a more module based scheme
wardsimon Jul 30, 2021
456375b
TOF support
wardsimon Aug 9, 2021
073b413
Decouple phases and EXP in cryspy
wardsimon Aug 10, 2021
1f2b9cb
Fix legacy mode loading
wardsimon Aug 10, 2021
236d27d
Use the correct references for legacy mode
AndrewSazonov Aug 10, 2021
695473b
Unification of naming conventions
wardsimon Aug 11, 2021
888ad48
Fix TOF generation
wardsimon Aug 11, 2021
a88eef8
Fix changing from TOF->CW
wardsimon Aug 12, 2021
a61dd37
Fix all interfaces to use new schema
wardsimon Aug 18, 2021
1579521
Update interface and exp_type verification logic
wardsimon Aug 18, 2021
bcf3474
cryspy multiprocess support
wardsimon Aug 19, 2021
b5bb31e
Change mp pool methodology
wardsimon Aug 20, 2021
be81a22
Add scaling parameters for phases
wardsimon Aug 20, 2021
c5a005c
Initial Polarization work
wardsimon Aug 23, 2021
32d85c0
Work on obtaining HKL
wardsimon Aug 24, 2021
28d9177
Fix get HKL
wardsimon Aug 24, 2021
fa52239
Update requirements
wardsimon Aug 24, 2021
ab2100b
Add TOF calculation for cryspy (#10)
wardsimon Aug 24, 2021
3650c46
Delete .devcontainer directory
wardsimon Aug 24, 2021
0cbd66b
Delete tools directory
wardsimon Aug 24, 2021
69d53ac
Tests base and README
wardsimon Aug 25, 2021
419ca5c
Update LICENSE
wardsimon Aug 25, 2021
a972008
Merge branch 'develop' into TOF
rozyczko Sep 8, 2021
bfed583
fixed/updated FittingData notebook
rozyczko Sep 10, 2021
97a36b3
more updates for new eC and eDL
rozyczko Sep 13, 2021
2723296
Disable Lorentzian coefficients
AndrewSazonov Sep 14, 2021
b574699
Added CreateSample notebook, added structure show to existing notebooks.
rozyczko Sep 14, 2021
daf5925
Cleaned up outputs
rozyczko Sep 15, 2021
19b97b8
Temporary workaround to get ADP value
AndrewSazonov Sep 16, 2021
084ceca
easyCore dependence temporarily changed
rozyczko Sep 16, 2021
8838fb5
Minor changes to the notebooks. Updated toml and fixed CFML interface
rozyczko Sep 19, 2021
a0893d4
Separated working notebooks to a different directory.
rozyczko Sep 20, 2021
1fd635a
Temporary workaround to get ADP value (GSASII)
AndrewSazonov Sep 21, 2021
4c89ad2
Fix return value; back to develop branch
AndrewSazonov Sep 21, 2021
87e8beb
Merge branch 'develop' into more_notebooks
rozyczko Sep 27, 2021
207bdd2
Add PbSO4 fitting notebook
AndrewSazonov Sep 27, 2021
b74fa94
Merge branch 'develop' into more_notebooks
wardsimon Sep 27, 2021
759b5fb
Merge branch 'more_notebooks' into release_preparation
wardsimon Sep 27, 2021
eb63de5
Merge branch 'more_notebooks' of https://github.com/easyScience/easyD…
rozyczko Sep 27, 2021
5353dfa
Updated notebooks, corrected dependency for easyCore
rozyczko Sep 27, 2021
4c04e65
Auto stash before merge of "more_notebooks" and "origin/more_notebooks"
wardsimon Sep 27, 2021
76f777a
Disable debug output for CFML
AndrewSazonov Sep 27, 2021
71be218
Use easyCore from the develop branch
AndrewSazonov Sep 27, 2021
4cd03c1
Update fitting notebook
AndrewSazonov Sep 27, 2021
4ef56f0
Move notebooks into 'examples' folder
AndrewSazonov Sep 27, 2021
e7e8dab
Add instruction on how to run Jupyter Notebook examples
AndrewSazonov Sep 27, 2021
1bce0b8
Update fitting example
AndrewSazonov Sep 27, 2021
a3997bf
Merge remote-tracking branch 'origin/more_notebooks' into more_notebooks
AndrewSazonov Sep 27, 2021
5d1ee63
Merge branch 'more_notebooks' into release_preparation
wardsimon Sep 28, 2021
d16ddb3
A bit better README
wardsimon Sep 28, 2021
0fb5947
Add contributing details
wardsimon Sep 28, 2021
513e9ca
Merge branch 'release_preparation' into more_notebooks
wardsimon Sep 28, 2021
3c08040
Start with tests
wardsimon Sep 28, 2021
6a78229
Merge branch 'release_preparation' into more_notebooks
wardsimon Sep 28, 2021
aaf6727
Delete setup.py
wardsimon Sep 28, 2021
febe16c
Update README.md
AndrewSazonov Sep 28, 2021
9133c6d
Update both `simulation` and `fitting` examples
AndrewSazonov Sep 28, 2021
530ca96
Update README.md
AndrewSazonov Sep 28, 2021
17c403f
Delete unused files
AndrewSazonov Sep 28, 2021
015217e
Added modified fix from the mp_mc branch to enable proper phase removal
rozyczko Sep 30, 2021
5e7392f
Merge branch 'phases_fix' into develop
rozyczko Oct 1, 2021
dfa183d
Update both `simulation` and `fitting` examples
AndrewSazonov Sep 28, 2021
0d1d414
Fix up Docs and files
wardsimon Oct 1, 2021
6598952
Update badge
wardsimon Oct 1, 2021
94a0651
Add generators
wardsimon Oct 1, 2021
f754022
Merge branch 'release_preparation' into develop
wardsimon Oct 1, 2021
b6657db
Update self_publish_alpha.yml
wardsimon Oct 1, 2021
fe9338d
Auto stash before merge of "develop" and "origin/develop"
wardsimon Oct 1, 2021
99d4cc0
Update self_publish_alpha.yml
wardsimon Oct 1, 2021
fb0e903
Update generate_html.py
wardsimon Oct 1, 2021
ecce553
Update self_publish_alpha.yml
wardsimon Oct 1, 2021
78ad79c
Update self_publish_alpha.yml
wardsimon Oct 1, 2021
b612523
Update self_publish_alpha.yml
wardsimon Oct 1, 2021
20dad3d
Auto stash before merge of "develop" and "origin/develop"
wardsimon Oct 1, 2021
e884311
Update self_publish_alpha.yml
wardsimon Oct 4, 2021
c55ab0c
Try to create tagged realease
wardsimon Oct 4, 2021
638ddf8
Rename from easyDiffractionLib to easyDiffraction
wardsimon Oct 4, 2021
219881c
Modify project and requirements
wardsimon Oct 4, 2021
5fbc026
Use easysciencecore >= 0.1.1a0
AndrewSazonov Oct 4, 2021
532744c
Only push if changes
wardsimon Oct 4, 2021
fbbbed7
Merge remote-tracking branch 'origin/develop' into develop
wardsimon Oct 4, 2021
51b2e11
Add `v` to tag
wardsimon Oct 4, 2021
f746eea
Update README.md
AndrewSazonov Oct 4, 2021
4f33ee5
Write all packages
wardsimon Oct 4, 2021
e11ad79
Add PR validation (needs labels)
wardsimon Oct 5, 2021
4751083
Add more branch protection stuff
wardsimon Oct 5, 2021
8f5cc14
Add documentation label
wardsimon Oct 5, 2021
56bacd3
Add the ability to launch examples on Binder (#12)
wardsimon Oct 5, 2021
44c3c00
Switch from `matplotlib` to `bokeh` in notebooks
AndrewSazonov Oct 6, 2021
0779668
Update requirements to use `bokeh` instead of `matplotlib`
AndrewSazonov Oct 6, 2021
94d40fb
Add links to non-interactive preview for notebooks
AndrewSazonov Oct 6, 2021
60e68ff
Fix import `easyDiffractionLib`
AndrewSazonov Oct 6, 2021
2471742
Update notebooks
AndrewSazonov Oct 6, 2021
b12a6cc
Update notebook
AndrewSazonov Oct 7, 2021
491bdd9
Update postBuild
wardsimon Oct 11, 2021
bcf107f
Update Simulation.ipynb
wardsimon Oct 11, 2021
3e99825
Update notebooks
wardsimon Oct 11, 2021
792089a
Add patch to autobuild (fix pypi arguments)
wardsimon Oct 11, 2021
966ec09
Create pypi_publish.yml
wardsimon Oct 11, 2021
c8ba665
Modified mp_mc branch with pathos multiprocessing commented out
rozyczko Nov 11, 2021
b7ef004
Merge branch 'develop' into multiphase
rozyczko Nov 11, 2021
be26f02
Added convencience methods for single phase profiles
rozyczko Nov 18, 2021
2644fae
Redefine additional_data['components'] with scaled values
rozyczko Nov 19, 2021
c7a6fc5
typo in toml
rozyczko Nov 20, 2021
d28e7d2
Implement multiphase with CFML
wardsimon Nov 26, 2021
5ff10ac
More CFML multiphase changes
wardsimon Nov 29, 2021
717a759
Fix memory issues again
wardsimon Nov 29, 2021
eefe821
Fix spacegroup errors for multiphase
wardsimon Dec 2, 2021
9d58010
Add support for the multiple HKL sets
AndrewSazonov Dec 10, 2021
ce2c833
x_array is unnecessary for cryspy - hkl has already been calculated in
rozyczko Dec 13, 2021
97a8a31
Fix for getting HKL's
wardsimon Jan 19, 2022
9dfd6b8
Use easyCrystallography
wardsimon Jan 19, 2022
50b8779
Added a multiphase fitting example
rozyczko Jan 19, 2022
41220e6
Merge branch 'multiphase' of https://github.com/easyScience/easyDiffr…
rozyczko Jan 19, 2022
978535e
Merge remote-tracking branch 'origin/easyCrystallography' into releas…
rozyczko Jan 20, 2022
4b0f77a
fix a "typo".
rozyczko Jan 21, 2022
70a478e
fixed method signatures.
rozyczko Jan 26, 2022
654560d
Merge branch 'develop' into release-0.8.3
rozyczko Feb 1, 2022
ee44d4a
Update requirements
rozyczko Feb 1, 2022
da41bb9
Test pre-release branch of easyCore
rozyczko Feb 1, 2022
b6ae64e
Updated copyright year
rozyczko Feb 2, 2022
38b5984
Try to use the release version of easyCore
rozyczko Feb 2, 2022
8b55434
Merge branch 'master' into develop
rozyczko Feb 2, 2022
1eb6726
update poetry
rozyczko Feb 4, 2022
0794742
Fetch easyCrystallography from pypi
rozyczko Feb 4, 2022
7c46415
Remove multiphase temp files on CFML calculator initialize #190 (#36)
rozyczko Mar 16, 2022
312646c
Update pytest requirement from ^5.2 to ^7.1 (#37)
dependabot[bot] Mar 16, 2022
dd97100
Update pyproject.toml (#38)
arm61 Mar 16, 2022
28e2ec2
added polarization and efficiency to instrument parameters
rozyczko Mar 17, 2022
47316dc
More polarization work and re-write of interface
wardsimon Mar 22, 2022
1c2bf9f
Cryspy V2
wardsimon Mar 24, 2022
c15da1d
removed some old polarized code from ToF
rozyczko Mar 24, 2022
60d8b9a
More v2 work
wardsimon Mar 25, 2022
527df83
Touch up polarisation class
wardsimon Mar 25, 2022
dde0a5c
Cleanup and refactor
wardsimon Mar 28, 2022
eee3f2b
Fix site generation
wardsimon Mar 29, 2022
ce7f06d
Corrected branch name for the crystallography module
rozyczko Mar 30, 2022
3ea4ba5
More work on cryspyV2
wardsimon Mar 30, 2022
0534a3d
Add magnetic Susceptibility to the`Site`
wardsimon Mar 30, 2022
b7564b3
Add Magnetic Susceptibility to calculator and cryspy interfaces
wardsimon Mar 30, 2022
74fd2c5
added polarized structure/experiment files
rozyczko Mar 31, 2022
35fd5fa
Update to use correct modules
wardsimon Mar 31, 2022
80a0e66
Update imports
wardsimon Mar 31, 2022
0de4546
More V2 update work
wardsimon Apr 1, 2022
80526f4
Fixed adding adps to kwargs
rozyczko Apr 4, 2022
8376215
Merge branch 'polarizedV2' of https://github.com/easyScience/easyDiff…
rozyczko Apr 4, 2022
2942d81
added msp support
rozyczko Apr 11, 2022
a1c2e07
Structure load fixes after changes in core
rozyczko Apr 20, 2022
013ae41
Number of fixes/extensions to allow polarized calculations.
rozyczko Apr 28, 2022
5d927a4
Minor fixes for the app functionality
rozyczko May 4, 2022
96121d3
Moved fit_func to derived class so it can be properly referenced.
rozyczko May 12, 2022
0ce3ba3
Enable refinement options to be passed to the calculator.
rozyczko May 20, 2022
ed617bb
Fixed refinement cases
rozyczko May 23, 2022
5bc6e84
Enabling beam polarization setup
rozyczko May 23, 2022
f09080a
Make Ciso default
rozyczko May 25, 2022
c824182
Fix loading multiphase project files
rozyczko Jun 7, 2022
a1c85e3
Added attribute to tell default msp from read in actual values
rozyczko Jun 20, 2022
b63f5b6
it_coordinate_system_code in cryspy spacegroup
wardsimon Jun 22, 2022
19c65de
MSP connection fix
wardsimon Jun 23, 2022
17bbfa3
Move cif module
wardsimon Jun 24, 2022
c9e564a
Minor fix to adding components
wardsimon Jun 24, 2022
16b2840
Fix order of the magnetic susceptibilities
AndrewSazonov Jun 24, 2022
6e6a00b
Merge remote-tracking branch 'origin/polarizedV2' into polarizedV2
wardsimon Jun 24, 2022
0c746aa
MSP optional for site
wardsimon Jun 24, 2022
d76e36e
Fix unpol -> pol switching on cryspyV2
wardsimon Jun 24, 2022
423c3e0
More pol work
wardsimon Jun 24, 2022
90544e6
Add magnetic field option
wardsimon Jun 27, 2022
19cf5f7
Temporarily remove normalisation
AndrewSazonov Jul 4, 2022
7fa252c
Added get_component getter for retrieving more information from
rozyczko Jul 5, 2022
2e8ec8b
Merge branch 'polarizedV2' of https://github.com/easyScience/easyDiff…
rozyczko Jul 5, 2022
fd86ed2
Update returned up/down profiles to match total
rozyczko Jul 6, 2022
4a367ff
Ci fix (#45)
rozyczko Jul 6, 2022
4556f09
Update pyproject.toml
wardsimon Jul 6, 2022
3418a02
Update requirements.txt
wardsimon Jul 6, 2022
212721b
Add methods to V2
rozyczko Jul 12, 2022
5710cca
Have the CFML and GSAS interfaces understand extended feature string
rozyczko Jul 13, 2022
fc928ae
Disabled cryspyV2 interface for the time being
rozyczko Jul 13, 2022
747bca9
Fix get hkl for CrysFML calculator
Jul 14, 2022
bf1e114
Merge remote-tracking branch 'origin/release-0.8.4' into polarizedV2
wardsimon Jul 14, 2022
32610c2
Auto stash before merge of "polarizedV2" and "origin/release-0.8.4"
wardsimon Jul 14, 2022
ffb3e7c
Added missing methods for GSAS.
rozyczko Jul 14, 2022
8aa0506
Merge branch 'release-0.8.4' of https://github.com/easyScience/easyDi…
rozyczko Jul 14, 2022
7af2fc3
Removed file deletion. It messes up with fitting on Windows and the
rozyczko Jul 18, 2022
3a95310
Added polarized notebook example.
wardsimon Jul 18, 2022
b3d6a64
Merge branch 'polarizedV2' into release-0.8.4
rozyczko Jul 20, 2022
59ecaa7
Use develop branch of easyCrystallography (with undo/redo fix)
Jul 21, 2022
3c12f5b
Added a conveience method
rozyczko Jul 21, 2022
1b1a270
Merge branch 'release-0.8.4' of https://github.com/easyScience/easyDi…
rozyczko Jul 21, 2022
7fc2ada
Merge branch 'master' into release-0.8.4
rozyczko Jul 25, 2022
a2c3b5d
version change 0.0.3 -> 0.0.4
rozyczko Jul 25, 2022
7ad16f2
switch to master on crystallography
rozyczko Jul 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8

- name: Some logging
shell: bash
Expand Down
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: stable # Replace by any tag/version: https://github.com/psf/black/tags
rev: 22.3.0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 # Use the ref you want to point at
rev: v4.3.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -15,13 +15,13 @@ repos:
- id: check-toml
- id: pretty-format-json
- id: detect-private-key
- repo: local
hooks:
- id: export_dev_requirements
name: Export dev requirements
language: system
pass_filenames: false
entry: peodd -o requirements-dev.txt
#- repo: local
# hooks:
# - id: export_dev_requirements
# name: Export dev requirements
# language: system
# pass_filenames: false
# entry: peodd -o requirements-dev.txt
# - id: export-requirements
# name: Export requeriments.txt
# language: system
Expand All @@ -34,7 +34,7 @@ repos:
# pass_filenames: false
# entry: ~/anaconda3/bin/poetry2setup > setup.py
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.1.0
rev: v2.3.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
Expand Down
26 changes: 23 additions & 3 deletions easyDiffractionLib/Interfaces/CFML.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
__version__ = "0.0.2"

import os
import glob
from easyCore import borg, np
from easyCore.Objects.Inferface import ItemContainer

from easyDiffractionLib import Lattice, SpaceGroup, Site, Phases, Phase

from easyDiffractionLib.Interfaces.interfaceTemplate import InterfaceTemplate
from easyDiffractionLib.Profiles.P1D import Instrument1DCWParameters, Powder1DParameters
from easyDiffractionLib.Calculators.CFML import CFML as CFML_calc
from easyDiffractionLib.calculators.CFML import CFML as CFML_calc


class CFML(InterfaceTemplate):
Expand Down Expand Up @@ -52,7 +53,7 @@ class CFML(InterfaceTemplate):
}
_pattern_link = {"scale": "scale", "x_offset": "x_offset"}

feature_available = {"Npowder1DCW": True}
feature_available = {"Npowder1DCW": True, "Npowder1DCWunp": True}

name = "CrysFML"

Expand Down Expand Up @@ -122,7 +123,7 @@ def create(self, model):
self.calculator.add_phase(str(model_key), model.name)
elif issubclass(t_, Sample):
self.__createModel(model)
elif t_.__name__ in ["Powder1DCW", "powder1DCW", "Npowder1DCW"]:
elif t_.__name__ in ["Powder1DCW", "powder1DCW", "Npowder1DCW", "Npowder1DCWunp"]:
self.__createModel(model)
else:
if self._borg.debug:
Expand Down Expand Up @@ -159,6 +160,8 @@ def get_hkl(self, x_array: np.ndarray = None, idx=None, phase_name=None, encoded
def dump_cif(self, *args, **kwargs):
if self._filename is None:
return
# delete preexising cif files
self.remove_cif()
with open(self._filename, "w") as fid:
fid.write(str(self._phase.cif))
base, file = os.path.split(self._filename)
Expand All @@ -168,6 +171,20 @@ def dump_cif(self, *args, **kwargs):
with open(f"{os.path.join(base, file)}_{idx}.{ext}", "w") as fid:
fid.write(str(phase.cif))

def remove_cif(self):
if self._filename is None:
return
base, file = os.path.split(self._filename)
ext = file[-3:]
file = file[:-4]
file_wildcarded = os.path.join(base, file) + '_*.' + ext
fileList = glob.glob(file_wildcarded)
for f in fileList:
try:
os.remove(f)
except OSError:
pass

def __createModel(self, model):
self._filename = model.filename
self.calculator.filename = model.filename
Expand All @@ -182,6 +199,9 @@ def get_value(self, key, item_key):
def get_phase_components(self, phase_name):
return None

def get_component(self, component_name):
return self.calculator.get_component(component_name)

def get_calculated_y_for_phase(self, phase_idx: int) -> list:
return self.calculator.get_calculated_y_for_phase(phase_idx)

Expand Down
16 changes: 13 additions & 3 deletions easyDiffractionLib/Interfaces/GSASII.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from easyCore import borg, np
from ..Interfaces.interfaceTemplate import InterfaceTemplate
from easyCore.Objects.Inferface import ItemContainer
from ..Calculators.GSASII import GSASII as GSAS_calc
from ..calculators.GSASII import GSASII as GSAS_calc
from easyDiffractionLib.Profiles.P1D import Instrument1DCWParameters, Powder1DParameters
from easyDiffractionLib import Lattice, SpaceGroup, Site, Phases

Expand Down Expand Up @@ -54,7 +54,8 @@ class GSASII(InterfaceTemplate):
}

feature_available = {
'Npowder1DCW': True
'Npowder1DCW': True,
'Npowder1DCWunp': True
}

name = 'GSASII'
Expand Down Expand Up @@ -108,7 +109,7 @@ def create(self, model):
self.dump_cif))
elif issubclass(t_, Phases):
self._phase = model
elif t_.__name__ in ['Powder1DCW', 'powder1DCW', 'Npowder1DCW']:
elif t_.__name__ in ['Powder1DCW', 'powder1DCW', 'Npowder1DCW', 'Npowder1DCWunp']:
# #TODO Check to see if parameters and pattern should be initialized here.
self.__createModel(model_key, 'powder1DCW')
elif issubclass(t_, Sample):
Expand Down Expand Up @@ -164,6 +165,15 @@ def __createModel(self, model):
def get_phase_components(self, phase_name):
return None

def get_component(self, component_name):
return None

def get_calculated_y_for_phase(self, phase_idx: int) -> list:
return self.calculator.get_calculated_y_for_phase(phase_idx)

def get_total_y_for_phases(self) -> list:
return self.calculator.get_total_y_for_phases()

@staticmethod
def __identify(obj):
return borg.map.convert_id_to_key(obj)
7 changes: 7 additions & 0 deletions easyDiffractionLib/Interfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
# TODO make this a proper message (use logging?)
print('Warning: CrysPy is not installed')


# try:
# from easyDiffractionLib.Interfaces.cryspyV2 import CryspyBase # noqa: F401
# except ImportError:
# # TODO make this a proper message (use logging?)
# print('Warning: CrysPy is not installed')

try:
from easyDiffractionLib.Interfaces.CFML import CFML # noqa: F401
except ImportError:
Expand Down
Loading