aiida_spirit.tools package

Submodules

aiida_spirit.tools._vfr module

Interface to the spirit web view used in the plotting tool.

aiida_spirit.tools._vfr.setup(vfr_frame_id='')[source]

Create a frame in the jupyter ntoebook to into which the spins are shown.

aiida_spirit.tools._vfr.update(positions, directions, rectilinear=True, vfr_frame_id='')[source]

Update the spins in the frame.

aiida_spirit.tools.get_from_remote module

Tools to get files from the remote folder

aiida_spirit.tools.get_from_remote.get_file_content_from_remote(node, fname)[source]

copy a text file from the remote to a temporary dir and load it from there

aiida_spirit.tools.get_from_remote.list_remote_files(node)[source]

Open an ssh connection and return the list of files in the remote

aiida_spirit.tools.helpers module

Helper functions for automatically setting up computer & code. Helper functions for setting up

  1. An AiiDA localhost computer

  2. A “spirit” code on localhost

aiida_spirit.tools.helpers.get_code(entry_point, computer)[source]

Get local code. Sets up code for given entry point on given computer.

Parameters
  • entry_point – Entry point of calculation plugin

  • computer – (local) AiiDA computer

Returns

The code node

Return type

aiida.orm.Code

aiida_spirit.tools.helpers.get_computer(name='localhost-test', workdir=None)[source]

Get AiiDA computer. Loads computer ‘name’ from the database, if exists. Sets up local computer ‘name’, if it isn’t found in the DB.

Parameters
  • name – Name of computer to load or set up.

  • workdir – path to work directory Used only when creating a new computer.

Returns

The computer node

Return type

aiida.orm.Computer

aiida_spirit.tools.helpers.get_path_to_executable(executable)[source]

Get path to local executable. :param executable: Name of executable in the $PATH variable :type executable: str :return: path to executable :rtype: str

aiida_spirit.tools.helpers.prepare_test_inputs(input_dir)[source]

Prepare the input parameters, structure and load the Jij’s for a simple SpiritCalculation for bcc Fe,

aiida_spirit.tools.plotting module

Plotting tools for aiida-spirit.

aiida_spirit.tools.plotting._plot_spins_vfr(pos_cell, n_basis_cells, cell, spin_directions, scale_spins=1.0, vfr_frame_id='')[source]

Construct positions and directions array and update the vfrendering spin view

aiida_spirit.tools.plotting.init_spinview(vfr_frame_id='')[source]

Initialize the vfrendering HTML object.

Needs to be called before the show_spins function can set the spins :param vfr_frame_id: a string that controls if multiple windows should be openend. Use the same string in show_spins to update this. This is not fully implemented yet and does not work in this version.

aiida_spirit.tools.plotting.show_spins(spirit_calc, show_final_structure=True, scale_spins=1.0, list_spin_files_on_remote=False, use_remote_spins_id=None, vfr_frame_id='')[source]

Update the vfrendering spin view plot with the final or initial spin structure.

Needs to have the init_spinview() function called to initialize a window where the plot is shown.

Parameters
  • spirit_calc – the SpiritCalculation which is supposed to be visualized

  • show_final_structure – boolean that tells us if the initial or final structure of the spins should be displayed

  • scale_spins – a scaling factor that can be used to scale the size of the arrows

  • list_spin_files_on_remote – print a list of the available spin image files on the remote folder.

  • 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).

  • vfr_frame_id – if given this allows to control into which spinview frame the spins are shown. Should be the same as in the init_spinview. This is not fully implemented yet and does not work in this version.

Module contents