Skip to content

Commit

Permalink
Small update in plotting function (#12)
Browse files Browse the repository at this point in the history
* Add scale_lattice option to plotting function

* Set language to english for docs build

* Build docs without warnings as errors
  • Loading branch information
PhilippRue authored Jul 18, 2022
1 parent 8d02b78 commit 11830eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions aiida_spirit/tools/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def show_spins( # pylint: disable=inconsistent-return-statements,too-many-argum
spirit_calc,
show_final_structure=True,
scale_spins=1.0,
scale_lattice=1.0,
list_spin_files_on_remote=False,
use_remote_spins_id=None,
mask=None,
Expand All @@ -90,6 +91,7 @@ def show_spins( # pylint: disable=inconsistent-return-statements,too-many-argum
:param spirit_calc: the SpiritCalculation which is supposed to be visualized
:param show_final_structure: boolean that tells us if the initial or final structure of the spins should be displayed
:param scale_spins: a scaling factor that can be used to scale the size of the arrows
:param scale_lattice: a scaling factor that can be used to scale the spacing of the atoms
:param list_spin_files_on_remote: print a list of the available spin image files on the remote folder.
:param use_remote_spins_id: show neither final nor initial spin structure but show the structure of
a certain checkpoint (see list_spin_files_on_remote=True output for available checkpoints).
Expand All @@ -108,6 +110,9 @@ def show_spins( # pylint: disable=inconsistent-return-statements,too-many-argum
struc = spirit_calc.inputs.structure
cell = np.array(struc.cell)
pos_cell = np.array([i.position for i in struc.sites])
# rescale lattice
cell *= scale_lattice
pos_cell *= scale_lattice

# get initial or final spin directions
if 'magnetization' not in spirit_calc.outputs:
Expand Down
5 changes: 4 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

## Runs nit-picky and converting warnings into errors to
## make sure the documentation is properly written
#customdefault:
# $(SPHINXBUILD) -b html -nW $(ALLSPHINXOPTS) $(BUILDDIR)/html
# do not convert warnings to errors to get it to run
customdefault:
$(SPHINXBUILD) -b html -nW $(ALLSPHINXOPTS) $(BUILDDIR)/html
$(SPHINXBUILD) -b html -n $(ALLSPHINXOPTS) $(BUILDDIR)/html

all: html

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down

0 comments on commit 11830eb

Please sign in to comment.