Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
cac42a1
new_job rebased off of current develop
rozyczko Apr 11, 2024
7e4ee46
get the "tests" to pass, fix the new test
rozyczko Apr 11, 2024
b376b79
updated tests
rozyczko Apr 11, 2024
b9e126e
fixed impl
rozyczko Apr 11, 2024
7deb6ae
added conversion tests
rozyczko Apr 11, 2024
feacdff
more Job content
rozyczko Apr 12, 2024
4237df3
added tests for Job.
rozyczko Apr 12, 2024
7b66460
fixed repo name
rozyczko Apr 13, 2024
17cde79
more functionality
rozyczko Apr 15, 2024
6b3be77
can't pass both job_type and experiment
rozyczko Apr 16, 2024
9816470
more implementation.
rozyczko Apr 16, 2024
c79e72f
More functionality and fixes
rozyczko Apr 17, 2024
db74895
start adding calculation elements
rozyczko Apr 18, 2024
77af055
work on datastore
rozyczko Apr 19, 2024
f31879d
fixed ruff
rozyczko Apr 19, 2024
e97317d
fixed job instantiation with job_type argument
rozyczko Apr 22, 2024
f1d3c1c
moved to easyscience + changed module name to easydiffraction
rozyczko Apr 22, 2024
6ed3e7e
ruff
rozyczko Apr 22, 2024
d4e85fe
name-less invocation, direct imports from edl, fixed argument name for
rozyczko Apr 22, 2024
1a064ce
changes after discussion with Andrew
rozyczko Apr 23, 2024
8eb4f21
Merge remote-tracking branch 'origin/new_easyscience' into new_job_dev
rozyczko Apr 25, 2024
3aaf23c
removed vestiges of easyDiffractionLib
rozyczko Apr 25, 2024
8b70f62
Initial work on Sample/Phase support
rozyczko Apr 26, 2024
2d1d7bc
temporarily disable pdffit2
rozyczko Apr 27, 2024
866429a
EXC sample is not deepcopy-able
rozyczko Apr 27, 2024
07adb40
ruff
rozyczko Apr 28, 2024
efe90d8
enable simple profile calculations
rozyczko Apr 29, 2024
f41afe6
minor fixes
rozyczko Apr 29, 2024
f737684
updated a few accessors for phase and sample
rozyczko May 1, 2024
0dc155e
cif parsers for experiment. part 1
rozyczko May 3, 2024
2898ddd
started refactoring out cif parser for the lib
rozyczko May 5, 2024
26ba937
work on cif parser
rozyczko May 6, 2024
a25f928
more cif parsing for experiment
rozyczko May 8, 2024
7da4e63
fixed failing test
rozyczko May 8, 2024
45958d6
allow range-less profile calculation
rozyczko May 14, 2024
bbbea45
be careful when querying datastore
rozyczko May 14, 2024
b4bf78e
added tof parsing.
rozyczko May 15, 2024
5bfc174
more cif related changes
rozyczko May 17, 2024
5cb883f
add tof and polarized
rozyczko May 22, 2024
14b3487
make background great again
rozyczko May 23, 2024
2b7a06a
fixes to background handling
rozyczko May 24, 2024
643845a
working fitting, after wedging in easyCore necessities
rozyczko May 28, 2024
53191f8
minor fixes, more tests
rozyczko May 31, 2024
91a39ae
move fitting, profile and minimizer/calculator logic to Analysis
rozyczko Jun 6, 2024
3512c43
updated notebooks for the new Job structure
rozyczko Jun 11, 2024
0b74136
back to pre-3.11 syntax
rozyczko Jun 11, 2024
1524f23
remove from_pars and defaults for background
rozyczko Jun 13, 2024
627633b
Update fitting notebook
rozyczko Jul 17, 2024
702ec2c
temporarily revert to ruff pre-0.5
rozyczko Jul 17, 2024
907435e
correct way of specifying ruff version for GH
rozyczko Jul 17, 2024
a885d68
new ruff with fixed E721s
rozyczko Jul 17, 2024
c4bc180
moved to theoretical_model
rozyczko Jul 19, 2024
7cda002
updates for the new easyscience module and related crystallography
rozyczko Aug 2, 2024
3864164
Merge branch 'new_job_dev' of https://github.com/EasyScience/EasyDiff…
rozyczko Aug 2, 2024
2397855
ruff
rozyczko Aug 2, 2024
f4ee469
move to global_object
rozyczko Aug 2, 2024
b342afc
case changes
rozyczko Aug 6, 2024
df42225
Merge branch 'new_job_dev' of https://github.com/EasyScience/EasyDiff…
rozyczko Aug 6, 2024
cf920d7
updated dependencies
rozyczko Aug 6, 2024
88ba237
Updated treatment of minimizers
rozyczko Aug 7, 2024
56cff12
Use the new API for minimizers
rozyczko Aug 8, 2024
f88790b
Fixes for multiphase load + updated notebook
rozyczko Aug 9, 2024
d58fc36
adjust default instrumental params
rozyczko Aug 12, 2024
650be8c
Import Lattice and SpaceGroup in __init__.py
AndrewSazonov Sep 16, 2024
3c22d8c
Add add_phase_from_file alias for add_sample_from_file
AndrewSazonov Sep 16, 2024
e6573b1
Rename atom_site to atom_sites, as this is a collection (loop in CIF)
AndrewSazonov Sep 16, 2024
02ea5e7
Remove unnecessary files
AndrewSazonov Sep 16, 2024
7d294a5
Add remove_phase to Job & fix removePhase in cryspy
AndrewSazonov Sep 16, 2024
ff1a02b
Add some examples to test API
AndrewSazonov Sep 16, 2024
d0b301c
merging new_job_dev_tof for the TOF functionality
rozyczko Sep 17, 2024
18437cd
removed cycle counter
rozyczko Sep 17, 2024
2de6dd1
Added TOF notebook. Fixed an issue with calculator
rozyczko Sep 17, 2024
bfdfd23
reparent easyCore dependency to be consistent with other modules
rozyczko Sep 18, 2024
6c8f6b3
fix for incorrect job setup for CW
rozyczko Sep 18, 2024
0b0736b
add manual trigger
rozyczko Sep 19, 2024
f75f30f
cleaned up code, added unit test
rozyczko Sep 23, 2024
a3e0a81
use updated cryspy and allow for sigma2 in gauss profile
rozyczko Sep 24, 2024
e6c7c34
preparations for the EDB merge
rozyczko Sep 24, 2024
9ab5dd3
switch to CW temporarily
rozyczko Sep 24, 2024
b126af0
fixed the staticmethod complaint
rozyczko Sep 24, 2024
af1d1ed
app related fixes
rozyczko Sep 27, 2024
925d114
Added xye TOF example.
rozyczko Oct 4, 2024
7f299f2
Merge branch 'new_job_dev' of https://github.com/EasyScience/EasyDiff…
rozyczko Oct 4, 2024
0c25c5a
cleaned up the notebook
rozyczko Oct 4, 2024
4cfcc2d
Fix bug in Simulation.ipynb
celinedurniak Oct 9, 2024
c19407a
fixed the offset direction for cw
rozyczko Oct 9, 2024
f27eb5d
Merge pull request #123 from EasyScience/fix_simulation_ipynb
rozyczko Oct 9, 2024
6b0f3d1
Fix name of the standard uncertainties data in the Experiment
AndrewSazonov Oct 9, 2024
3ad3f2a
fixed fitting of pattern parameters
rozyczko Oct 10, 2024
350f918
Merge branch 'new_job_dev' of https://github.com/EasyScience/EasyDiff…
rozyczko Oct 10, 2024
ecfc75c
allow for change of units of zero_shift
rozyczko Oct 10, 2024
d477420
moved cif parsers to Experiment and fixed the serialization of job
rozyczko Oct 11, 2024
bbc4ac4
added phase scaling block, fixed ruff
rozyczko Oct 11, 2024
f789458
Disable warning if PdfFit2 is not loaded
AndrewSazonov Oct 14, 2024
d496d48
Disable warning if CrysPy is imported
AndrewSazonov Oct 14, 2024
e4e5674
Extend job with extra functionality
AndrewSazonov Oct 14, 2024
d108e3e
Add Fitting_PD-TOF_Si-SEPD@Argonne example
AndrewSazonov Oct 14, 2024
60cd417
Modify the dependencies and add the `charts` install option
AndrewSazonov Oct 14, 2024
f4e158f
Update Google Colab import section
AndrewSazonov Oct 14, 2024
5bdffed
Remove duplicate
AndrewSazonov Oct 14, 2024
fa9a315
Fix analysis chart color and lines order
AndrewSazonov Oct 14, 2024
e0a7fb2
Add another example Fitting_PD-CW_La0.5Ba0.5CoO3-HRPT@PSI
AndrewSazonov Oct 14, 2024
81d3013
Add another example Fitting_PD-CW_La0.5Ba0.5CoO3-HRPT@PSI
AndrewSazonov Oct 14, 2024
7eca7ec
Update readme
AndrewSazonov Oct 14, 2024
8bee7f2
Fix url
AndrewSazonov Oct 14, 2024
0939768
merge changes from `beta3` branch to unify the branches
rozyczko Oct 14, 2024
f149c02
Merge branch 'new_job_dev' of https://github.com/EasyScience/EasyDiff…
rozyczko Oct 14, 2024
77a4654
satisfy ruff
rozyczko Oct 14, 2024
f286dee
Fix readme
AndrewSazonov Oct 14, 2024
54ff682
Add show_crystal_structure
AndrewSazonov Oct 14, 2024
d2ca1af
new_job_dev fails, temporarily use new_job_dev2
AndrewSazonov Oct 14, 2024
3dab1f0
Play with py3dmol
AndrewSazonov Oct 14, 2024
e34ffb5
Update examples
AndrewSazonov Oct 14, 2024
dc7b0d3
Update notebooks
AndrewSazonov Oct 14, 2024
47c9f41
Add py3Dmol to the list of extra dependencies
AndrewSazonov Oct 14, 2024
5e5ab99
Update notebooks
AndrewSazonov Oct 14, 2024
8245606
don't update the dict when there's nothing to update (lib)
rozyczko Oct 15, 2024
7d5f43c
improved performance of jobs run through the library interface
rozyczko Oct 17, 2024
347284c
remove unneeded assignment
rozyczko Oct 18, 2024
7522a25
Update notebooks
AndrewSazonov Oct 18, 2024
e9dddf5
Merge branch 'new_job_dev' into new_job_dev2
AndrewSazonov Oct 18, 2024
43aa370
add _space_group_IT_coordinate_system_code conversion for v2->v1
rozyczko Oct 18, 2024
2a7970f
Merge branch 'new_job_dev' into new_job_dev2
AndrewSazonov Oct 18, 2024
78ce75f
Extend edToCryspyNamesMap
AndrewSazonov Oct 18, 2024
9967f91
Reorganize the structure of the folder with examples
AndrewSazonov Oct 21, 2024
24e64a3
Use pooch to retrieve files from GitHub
AndrewSazonov Oct 21, 2024
5f25692
Update examples
AndrewSazonov Oct 21, 2024
cd704a2
Fix urls to data
AndrewSazonov Oct 21, 2024
4b75567
Update pyproject
AndrewSazonov Oct 21, 2024
9fb669d
Fix pyproject.toml
AndrewSazonov Oct 21, 2024
b8119aa
Fix Development Status in pyproject
AndrewSazonov Oct 21, 2024
c379c79
Merge branch 'new_job_dev2' into new_job_dev
AndrewSazonov Oct 21, 2024
668ad67
fixed fitting for manually added phase
rozyczko Oct 21, 2024
430a145
Merge branch 'new_job_dev' of https://github.com/EasyScience/EasyDiff…
rozyczko Oct 21, 2024
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
12 changes: 6 additions & 6 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

name: CI using pip

# Trigger the workflow on push or pull request
on: [push, pull_request]
# Trigger the workflow on push, pull request and manual trigger
on: [push, pull_request, workflow_call]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -58,10 +58,10 @@ jobs:
run: |
pip install -e '.[dev]'

# - name: Test with tox
# run: |
# pip install tox tox-gh-actions coverage
# tox
- name: Test with tox
run: |
pip install tox tox-gh-actions coverage
tox

# - name: Upload coverage
# uses: codecov/codecov-action@v3
Expand Down
13 changes: 0 additions & 13 deletions CHANGELOG.md

This file was deleted.

89 changes: 87 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
## Contributing
We absolutely welcome contributions. **easyDiffractionLib** is maintained by the ESS and on a volunteer basis and thus we need to foster a community that can support user questions and develop new features to make this software a useful tool for all users while encouraging every member of the community to share their ideas.
# Contributing

When contributing to the EasyDiffractionLib repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community

Examples of unacceptable behavior by participants include:

* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at suport@easydiffraction.org. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# [![Unit Tests][20]][21] ![Release][31] [![Downloads][70]][71] [![Lines of code][81]](<>) [![Total lines][80]](<>) [![Files][82]](<>) [![License][50]][51] [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/easyScience/easyDiffractionLib/develop)


[![](http://github-actions.40ants.com/easyScience/easyDiffractionLib/matrix.svg)](https://github.com/easyScience/easyDiffractionLib/actions)

<img height="80"><img src="https://raw.githubusercontent.com/easyScience/easyDiffractionApp/master/resources/images/ed_logo.svg" height="65">

**easydiffractionLib** is a Python library which provides:
**Easydiffraction** is a Python library which provides:
* Scripting interface to simulate and analyse neutron diffraction patterns.
* Multiple optimization algorithms to minimize models to experimental data: [Lmfit](https://lmfit.github.io/lmfit-py/), [Bumps](https://github.com/bumps/bumps) and [DFO_LS](https://github.com/numericalalgorithmsgroup/dfols).
* Multiple calculation engines: [CrysPy](https://github.com/ikibalin/cryspy), [CrysFML](https://www.ill.eu/sites/fullprof/php/programs24b7.html?pagina=Crysfml).

**easydiffractionLib** is the foundation of [**easyDiffraction**](https://github.com/easyScience/easyDiffraction), an intuitive application which endeavors simplifying and accelerating the analysis of diffraction experiments.
**Easydiffraction** library is the foundation of [**EasyDiffraction** application](https://github.com/easyscience/easydiffractionapp), an intuitive application which endeavors simplifying and accelerating the analysis of diffraction experiments.

## Getting Started

### Install easyDiffractionLib
### Install EasyDiffraction python library

Currently **easyDiffractionLib** is in **alpha** and has not been released on **pypi**. Please use the alternative method given below to install **easyDiffractionLib** from our [custom Python Package Index](https://easyscience.github.io/pypi).
Currently **easydiffraction** is in **alpha** and has not been released on **pypi**. Please use the alternative method given below to install **easydiffraction** from our GitHub repository.

* Create and go to, e.g., **easyDiffraction** directory (*optional*)
* Create and go to, e.g., **easydiffraction** directory (*optional*)
```
mkdir easyDiffraction && cd easyDiffraction
mkdir easydiffraction && cd easydiffraction
```
* Create virtual environment and activate it (*optional*)
```
Expand All @@ -31,25 +30,25 @@ Currently **easyDiffractionLib** is in **alpha** and has not been released on **
```
pip install --upgrade pip
```
* Install **easyDiffractionLib**
* Install **easydiffraction** with extras
```
pip install easyDiffraction --extra-index-url https://easyscience.github.io/pypi
pip install 'easydiffraction[charts] @ git+https://github.com/easyscience/easydiffractionlib.git@new_job_dev2'
```

## Examples

### Jupyter Notebook examples that use easyDiffractionLib
### Jupyter Notebook examples that use EasyDiffraction

#### Locally

* Install **easyDiffractionLib** as described above
* Install Jupyter Notebook and visualization libraries, such as **py3Dmol** and **bokeh** (*if not done already*)
* Install **easydiffraction** as described above, including `charts` extras for visualization
* Install Jupyter Notebook
```
pip install notebook py3Dmol bokeh
pip install notebook
```
* Download **easyDiffractionLib** Jupyter Notebook [examples](https://github.com/easyScience/easyDiffractionLib/tree/master/examples) from GitHub, e.g., using **svn** (*if not done already*)
* Download **easyDiffractionLib** Jupyter Notebook [examples](https://github.com/easyscience/easydiffractionlib/tree/new_job_dev2/examples) from GitHub, e.g., using **svn** (*if not done already*)
```
svn export https://github.com/easyScience/easyDiffractionLib/branches/master/examples
svn export https://github.com/easyscience/easydiffractionlib/branches/new_job_dev2/examples
```
* Run Jupyter Notebook server
```
Expand All @@ -61,14 +60,21 @@ Currently **easyDiffractionLib** is in **alpha** and has not been released on **
```
* Select one of the ***.ipynb** files

#### Via Binder (interactive)
#### Via Google Colab (interactive, requires google account)

##### Neutron powder diffraction

Examples can also be run on the online service [**Binder**](https://mybinder.org/). Click [launch **Binder**](https://mybinder.org/v2/gh/easyScience/easyDiffractionLib/master) and navigate to the examples folder to run one of the notebooks or create your own.
* [Fitting, constant wavelength, La0.5Ba0.5CoO3 - HRPT@PSI](https://colab.research.google.com/github/EasyScience/EasyDiffractionLib/blob/new_job_dev2/examples/Fitting_PD-NEUT-CW_LBCO-HRPT.ipynb)
* [Fitting, time-of-flight, Si - SEPD@Argonne](https://colab.research.google.com/github/EasyScience/EasyDiffractionLib/blob/new_job_dev2/examples/Fitting_PD-NEUT-TOF_Si-SEPD.ipynb)
* [Fitting, time-of-flight, Na2Ca3Al2F14 - WISH@ISIS](https://colab.research.google.com/github/EasyScience/EasyDiffractionLib/blob/new_job_dev2/examples/Fitting_PD-NEUT-TOF_NCAF-WISH.ipynb)

#### Via nbviewer (non-interactive preview)

* [Simulation](https://nbviewer.jupyter.org/github/easyScience/easyDiffractionLib/blob/master/examples/Simulation.ipynb)
* [Fitting](https://nbviewer.jupyter.org/github/easyScience/easyDiffractionLib/blob/master/examples/Fitting.ipynb)
##### Neutron powder diffraction

* [Fitting, constant wavelength, La0.5Ba0.5CoO3 - HRPT@PSI](https://nbviewer.org/github/EasyScience/EasyDiffractionLib/blob/new_job_dev2/examples/Fitting_PD-NEUT-CW_LBCO-HRPT.ipynb)
* [Fitting, time-of-flight, Si - SEPD@Argonne](https://nbviewer.org/github/EasyScience/EasyDiffractionLib/blob/new_job_dev2/examples/Fitting_PD-NEUT-TOF_Si-SEPD.ipynb)
* [Fitting, time-of-flight, Na2Ca3Al2F14 - WISH@ISIS](https://nbviewer.org/github/EasyScience/EasyDiffractionLib/blob/new_job_dev2/examples/Fitting_PD-NEUT-TOF_NCAF-WISH.ipynb)

## Test

Expand Down
27 changes: 0 additions & 27 deletions easyDiffractionLib/Interfaces/__init__.py

This file was deleted.

11 changes: 0 additions & 11 deletions easyDiffractionLib/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
import os

import numpy as np
from easyCore import borg
from easyCore.Objects.Inferface import ItemContainer
from easyscience import global_object as borg
from easyscience.Objects.Inferface import ItemContainer

from easyDiffractionLib import Lattice
from easyDiffractionLib import Phase
from easyDiffractionLib import Phases
from easyDiffractionLib import Site
from easyDiffractionLib import SpaceGroup
from easyDiffractionLib.calculators.CFML import CFML as CFML_calc
from easyDiffractionLib.Interfaces.interfaceTemplate import InterfaceTemplate
from easyDiffractionLib.Profiles.P1D import Instrument1DCWParameters
from easyDiffractionLib.Profiles.P1D import Powder1DParameters
from easydiffraction import Lattice
from easydiffraction import Phase
from easydiffraction import Phases
from easydiffraction import Site
from easydiffraction import SpaceGroup
from easydiffraction.calculators.CFML import CFML as CFML_calc
from easydiffraction.Interfaces.interfaceTemplate import InterfaceTemplate
from easydiffraction.Profiles.P1D import Instrument1DCWParameters
from easydiffraction.Profiles.P1D import Powder1DParameters


class CFML(InterfaceTemplate):
Expand Down Expand Up @@ -86,7 +86,7 @@ def feature_checker(
)

def create(self, model):
from easyDiffractionLib.sample import Sample
from easydiffraction.sample import Sample

r_list = []
t_ = type(model)
Expand Down Expand Up @@ -131,9 +131,6 @@ def create(self, model):
self.__createModel(model)
elif t_.__name__ in ["Powder1DCW", "powder1DCW", "Npowder1DCW", "Npowder1DCWunp"]:
self.__createModel(model)
else:
if self._borg.debug:
print(f"I'm a: {type(model)}")
return r_list

def link_atom(self, crystal_obj, atom):
Expand Down Expand Up @@ -223,4 +220,4 @@ def get_total_y_for_phases(self) -> list:

@staticmethod
def __identify(obj):
return borg.map.convert_id_to_key(obj)
return obj.unique_name
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
__version__ = "0.0.2"

import numpy as np
from easyCore import borg
from easyCore.Objects.Inferface import ItemContainer
from easyscience import global_object as borg
from easyscience.Objects.Inferface import ItemContainer

from easyDiffractionLib import Lattice
from easyDiffractionLib import Phases
from easyDiffractionLib import Site
from easyDiffractionLib import SpaceGroup
from easyDiffractionLib.Profiles.P1D import Instrument1DCWParameters
from easyDiffractionLib.Profiles.P1D import Powder1DParameters
from easydiffraction import Lattice
from easydiffraction import Phases
from easydiffraction import Site
from easydiffraction import SpaceGroup
from easydiffraction.Profiles.P1D import Instrument1DCWParameters
from easydiffraction.Profiles.P1D import Powder1DParameters

from ..calculators.GSASII import GSASII as GSAS_calc
from ..Interfaces.interfaceTemplate import InterfaceTemplate
Expand Down Expand Up @@ -79,7 +79,7 @@ def feature_checker(radiation='N', exp_type='CW', sample_type='powder', dimensio
FEATURES=GSASII.feature_available)

def create(self, model):
from easyDiffractionLib.sample import Sample
from easydiffraction.sample import Sample
r_list = []
t_ = type(model)
model_key = self.__identify(model)
Expand Down Expand Up @@ -121,9 +121,7 @@ def create(self, model):
self.__createModel(model)
elif issubclass(t_, Sample):
self.__createModel(model)
else:
if self._borg.debug:
print(f"I'm a: {type(model)}")

return r_list

def link_atom(self, crystal_obj, atom):
Expand Down
28 changes: 28 additions & 0 deletions easydiffraction/Interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
__author__ = 'github.com/wardsimon'
__version__ = '0.0.1'


try:
from easydiffraction.Interfaces.cryspyV2 import CryspyBase # noqa: F401
except ImportError:
print('Warning: CrysPy is not installed')

# Temporarily disabling the CrysFML and GSASII interfaces
# try:
# from easydiffraction.Interfaces.CFML import CFML # noqa: F401
# except ImportError:
# print('Warning: CrysFML is not installed')

# try:
# from easydiffraction.Interfaces.GSASII import GSASII # noqa: F401
# except ImportError:
# print('Warning: GSAS-2 is not installed')

try:
from easydiffraction.Interfaces.pdffit2 import Pdffit2 # noqa: F401
except ImportError:
pass
#print('Warning: PdfFit2 is not installed')

from easydiffraction.Interfaces.interfaceTemplate import InterfaceTemplate as InterfaceTemplate # noqa: F401

Loading