Skip to content

Commit

Permalink
from muesr.io to muesr.i-o
Browse files Browse the repository at this point in the history
  • Loading branch information
bonfus committed Feb 1, 2017
1 parent 3600918 commit d8b8119
Show file tree
Hide file tree
Showing 28 changed files with 39 additions and 222 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Known problems
Please not that the code is still under heavy development.
You'll probably find bugs so please report them!

Authors
-------

Pietro Bonfa', Ifeanyi John Onuorah and Roberto De Renzi.

Notes
-----

Expand Down
6 changes: 3 additions & 3 deletions docs/Install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ installed to use *all* features of Muesr:
========= ========= =============================================== =========================================
Package Version Required for Package URL
========= ========= =============================================== =========================================
YAML >= 2.0.0 :mod:`muesr.io.sampleIO` http://pyyaml.org/
YAML >= 2.0.0 :mod:`muesr.i_o.sampleIO` http://pyyaml.org/
Spglib >= 1.6 :mod:`muesr.utilities.symsearch` http://atztogo.github.io/spglib/
Sympy >= 1.0 :mod:`muesr.core.magmodel.SMM` http://sympy.org
appdirs >= 1.1 :mod:`muesr.settings`
XCrysDen >= 1.0 :mod:`muesr.io.xsf.xsf.show_cell` , http://www.xcrysden.org
:mod:`muesr.io.xsf.xsf.show_supercell`
XCrysDen >= 1.0 :mod:`muesr.i_o.xsf.xsf.show_cell` , http://www.xcrysden.org
:mod:`muesr.i_o.xsf.xsf.show_supercell`
========= ========= =============================================== =========================================

.. note::
Expand Down
2 changes: 1 addition & 1 deletion docs/LiFePO4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The sample object holds the following information:
The lattice structure is orthorhombic, with *Pnma* symmetry and
lattice parameters :math:`a=10.3244(2), b=6.0064(3), c=4.6901(5)`.
We can import these data from a CIF file using the function
:py:func:`~muesr.io.cif.cif.load_cif`:
:py:func:`~muesr.i_o.cif.cif.load_cif`:

.. literalinclude:: ../examples/LiFePO4/run_example.py
:lines: 31
Expand Down
8 changes: 4 additions & 4 deletions docs/Tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ files. Here's a few examples:
.. code-block:: python
>>> # load data from XCrysden .xsf file
>>> from muesr.io.xsf.xsf import load_xsf
>>> from muesr.i_o.xsf.xsf import load_xsf
>>>
>>> load_xsf(mysample, "/path/to/file.xsf")
>>>
>>>
>>> # load data from .cif file
>>> from muesr.io.cif.cif import load_cif
>>> from muesr.i_o.cif.cif import load_cif
>>>
>>> load_cif(mysample, "/path/to/file.cif")
>>>
>>>
>>> # load data from .mcif file
>>> from muesr.io.cif.cif import load_mcif
>>> from muesr.i_o.cif.cif import load_mcif
>>>
>>> load_mcif(mysample, "/path/to/file.mcif")
The :py:func:`~muesr.io.cif.cif.load_cif` function will also load symmetry information.
The :py:func:`~muesr.i_o.cif.cif.load_cif` function will also load symmetry information.
Please note that only a single lattice structure at a time can be
defined so each load function will remove the previous lattice structure
definition.
Expand Down
10 changes: 5 additions & 5 deletions docs/Usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ However this can be tedious and error prone. Therefore you are strongly
suggested to load the lattice information from a file using use one of
these functions:

- :py:func:`~muesr.io.cif.cif.load_cif` for Crystallographic Information Files
- :py:func:`~muesr.io.cif.cif.load_mcif` for Magnetic Crystallographic Information Files
- :py:func:`~muesr.io.xsf.xsf.load_xsf` for XCrysDen files.
- :py:func:`~muesr.i_o.cif.cif.load_cif` for Crystallographic Information Files
- :py:func:`~muesr.i_o.cif.cif.load_mcif` for Magnetic Crystallographic Information Files
- :py:func:`~muesr.i_o.xsf.xsf.load_xsf` for XCrysDen files.

.. note ::
For CIF files the symmetry is automatically parsed and set from the file.
Expand Down Expand Up @@ -326,8 +326,8 @@ Exceptions are only raised in core components.
Saving and loading sample details to/from file
----------------------------------------------

To save a sample use :py:func:`~muesr.io.sampleIO.save_sample`. To load
a saved sample use :py:func:`~muesr.io.sampleIO.load_sample`.
To save a sample use :py:func:`~muesr.i_o.sampleIO.save_sample`. To load
a saved sample use :py:func:`~muesr.i_o.sampleIO.load_sample`.

Data is stored in an YAML file. It is possible (but error prone) to write
an input file by hand. When loaded, the file will undergo a minimal
Expand Down
6 changes: 3 additions & 3 deletions examples/Fe_bcc/run_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import numpy as np
from muesr.core.sample import Sample # Retains all the sample info.
from muesr.io.cif.cif import load_cif # For loading the structure from cif files
from muesr.io.xsf.xsf import load_xsf # For loading the structure from xsf files
from muesr.io.xsf.xsf import show_supercell, show_cell # For visualisation with xcrysden (http://www.xcrysden.org/)
from muesr.i_o.cif.cif import load_cif # For loading the structure from cif files
from muesr.i_o.xsf.xsf import load_xsf # For loading the structure from xsf files
from muesr.i_o.xsf.xsf import show_supercell, show_cell # For visualisation with xcrysden (http://www.xcrysden.org/)
from muesr.utilities.ms import mago_add # For magnetic structure description
from muesr.engines.clfc import locfield # Does the sum and returns the local field in its diff. contributions
from muesr.engines.clfc import find_largest_sphere # Aids in the calculation of the sphere's radius for the lattice sum.
Expand Down
2 changes: 1 addition & 1 deletion examples/LaFeAsO/run_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
np.set_printoptions(precision=3,suppress=True)

from muesr.core.sample import Sample
from muesr.io.cif.cif import load_mcif
from muesr.i_o.cif.cif import load_mcif
from muesr.utilities.symsearch import symsearch
from muesr.utilities import muon_find_equiv
from muesr.engines.clfc import locfield
Expand Down
2 changes: 1 addition & 1 deletion examples/LiFePO4/run_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os # join path on windows.

from muesr.core import Sample # this object contains all the info on our sample
from muesr.io import load_cif # loads lattice and symmetry from CIF file
from muesr.i_o import load_cif # loads lattice and symmetry from CIF file
from muesr.utilities import mago_add # this function provides a CLI for inserting the MAGnetic Order
from muesr.engines.clfc import locfield # this is the function which actually performs the sum and returns
# the local fields.
Expand Down
2 changes: 1 addition & 1 deletion examples/MnSi/run_example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
import numpy as np
from muesr.core.sample import Sample
from muesr.io import load_cif
from muesr.i_o import load_cif
from muesr.utilities import print_cell, muon_find_equiv
from muesr.engines.clfc import locfield
from matplotlib import pyplot as plt
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions muesr/io/cif/cif.py → muesr/i_o/cif/cif.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from muesr.core.spg import Spacegroup
from muesr.core.nprint import nprint, nprintmsg

from muesr.io.cif.crystal import crystal
from muesr.i_o.cif.crystal import crystal
from muesr.core.spg import spacegroup_from_data
from muesr.io.cif.cell import cellpar_to_cell
from muesr.i_o.cif.cell import cellpar_to_cell



Expand Down
2 changes: 1 addition & 1 deletion muesr/io/cif/crystal.py → muesr/i_o/cif/crystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from muesr.core.atoms import Atoms
from muesr.core.spg import Spacegroup
from muesr.io.cif.cell import cellpar_to_cell
from muesr.i_o.cif.cell import cellpar_to_cell

__all__ = ['crystal']

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions muesr/io/xsf/xsf.py → muesr/i_o/xsf/xsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from muesr.settings import config

from muesr.io.xsf.xsfio import *
from muesr.io.xsf.xsfrun import *
from muesr.i_o.xsf.xsfio import *
from muesr.i_o.xsf.xsfrun import *

from muesr.core.sampleErrors import MuonError
from muesr.core.parsers import *
Expand Down
File renamed without changes.
File renamed without changes.
188 changes: 0 additions & 188 deletions muesr/io/ms_from_mcif.py

This file was deleted.

2 changes: 1 addition & 1 deletion muesr/tests/io/test_sampleIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from muesr.core.sample import Sample
from muesr.core.sampleErrors import *
from muesr.io.sampleIO import *
from muesr.i_o.sampleIO import *

yaml_only_lattice = """
Lattice:
Expand Down
4 changes: 2 additions & 2 deletions muesr/tests/test_muesr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from muesr.core.magmodel import MM, have_sympy
if have_sympy:
from muesr.core.magmodel import SMM
from muesr.io.xsf.xsf import load_xsf
from muesr.io.cif.cif import load_mcif
from muesr.i_o.xsf.xsf import load_xsf
from muesr.i_o.cif.cif import load_mcif
from muesr.engines.clfc import locfield
from muesr.utilities.muon import muon_reset, muon_set_frac

Expand Down
2 changes: 1 addition & 1 deletion muesr/tests/utilities/test_dftgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from muesr.core.sampleErrors import CellError, MuonError
from muesr.core.sample import Sample
from muesr.utilities.dft_grid import build_uniform_grid
from muesr.io.cif.cif import read_cif
from muesr.i_o.cif.cif import read_cif

co_lattice = StringIO("""
#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion muesr/tests/utilities/test_muon.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from muesr.core.sampleErrors import CellError, MuonError
from muesr.core.sample import Sample
from muesr.utilities import muon_set_frac, muon_find_equiv, muon_reset
from muesr.io.cif.cif import read_cif
from muesr.i_o.cif.cif import read_cif

co_lattice = StringIO("""
#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion muesr/tests/utilities/test_symsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from muesr.core.sampleErrors import CellError, MuonError
from muesr.core.sample import Sample
from muesr.utilities.symsearch import symsearch, have_spg
from muesr.io.cif.cif import read_cif
from muesr.i_o.cif.cif import read_cif


co_lattice = StringIO("""
Expand Down

0 comments on commit d8b8119

Please sign in to comment.