CASM Python packages documentation

casm.api

casm.api.API() Class to provide access to the libccasm C API.

casm.learn

casm.learn.create_halloffame(maxsize[, rel_tol])
casm.learn.EqualIndividual([rel_tol]) Functor class for checking equivalence of individuals in a HallOfFame.
casm.learn.empty_individual(n_features)
casm.learn.example_input_Lasso()
casm.learn.example_input_LassoCV()
casm.learn.example_input_RFE()
casm.learn.example_input_GeneticAlgorithm()
casm.learn.example_input_IndividualBestFirst()
casm.learn.example_input_PopulationBestFirst()
casm.learn.example_input_DirectSelection()
casm.learn.open_input(input_filename) Read casm-learn input file into a dict
casm.learn.set_input_defaults(input[, …]) Set common input defaults.
casm.learn.FittingData(X, y, cv[, …]) FittingData holds feature values, target values, sample weights, etc.
casm.learn.TrainingData(input[, verbose]) TrainingData is a data structure used to collect data from the training data file.
casm.learn.print_input_help()
casm.learn.print_individual(hall, indices[, …]) Print selected individuals from hall of fame.
casm.learn.print_population(pop) Print all individual in a population.
casm.learn.print_halloffame(hall[, format]) Print all individual in hall of fame.
casm.learn.print_eci(eci) Print ECI.
casm.learn.to_json(index, indiv) Serialize an individual to JSON records.
casm.learn.open_halloffame(halloffame_filename) Open hall of fame from .pkl file.
casm.learn.save_halloffame(hall, …[, verbose]) Save hall of fame as .pkl file.
casm.learn.checkspecs(input[, verbose]) Output data and cv files containing the current problem specs.
casm.learn.checkhull(input, hall[, indices, …]) Check for hull properties and add pandas.DataFrame attributes to each individual:
casm.learn.fit_and_select(input[, save, …])
param input:The input settings as a dict
casm.learn.direct_fit(input[, save, …]) Fit ECI and add details for a set of individuals specified for feature_selection method ‘DirectSelection’ via the ‘population’ kwarg.

casm.plotting

casm.plotting.ConvexHullPlot([data, …]) Attributes:
casm.plotting.GridPlot(sel[, x, y, type, …]) Attributes:
casm.plotting.Histogram([data, project, …]) Attributes:
casm.plotting.PlottingData()
casm.plotting.RankPlot([data, project, …]) Attributes:
casm.plotting.Scatter([data, project, …]) Attributes:
casm.plotting.TapAction(data) Enable execution of a python function when a glyph is ‘tapped’ in a bokeh plot.
casm.plotting.add_src_data(sel, name, data) Add data to Selection’s ColumnDataSource, creating if necessary
casm.plotting.clex_hull_style(input)
casm.plotting.default_clex_hull_style dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.plotting.default_dft_hull_style dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.plotting.default_figure_kwargs dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.plotting.default_scatter_style dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.plotting.dft_hull_style(input)
casm.plotting.rankplot_style(input)
casm.plotting.rank_select_cutoff_style dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.plotting.scatter_series_style(index, input)
casm.plotting.update_clex_hull_glyphs(sel, style) Use the selected and on_hull iterables to update glyph styles based on sel.clex_style.
casm.plotting.update_dft_hull_glyphs(sel, style) Use the selected and on_hull iterables to update glyph styles based on sel.dft_style.
casm.plotting.update_scatter_glyphs(sel, …)
casm.plotting.view_on_tap(sel, attrname, …) Execute ‘casm view’ on tapped configuration
casm.plotting.PlotTypeCommand

casm.project

casm.project.project_path([dir]) Crawl up from dir to find ‘.casm’.
casm.project.ClexDescription(name, property, …) Settings for a cluster expansion
casm.project.ProjectSettings([path]) Settings for a CASM project
casm.project.DirectoryStructure([path]) Standard file and directory locations for a CASM project
casm.project.Project([path, casm_exe, verbose]) The Project class contains information about a CASM project
casm.project.Prim(proj) The Primitive Crystal Structure
casm.project.Selection([proj, path, all]) A Selection object contains information about a CASM project
casm.project.query(proj, columns[, …]) Return a pandas DataFrame object containing the output of a ‘casm query’ command.
casm.project.write_eci(proj, eci[, …]) Write eci.json

casm.qewrapper

casm.qewrapper.QEWrapperError(msg)
casm.qewrapper.Relax([configdir, auto, sort]) The Relax class contains functions for setting up, executing, and parsing a Quantum Espresso relaxation.
casm.qewrapper.qe_input_file_names(dirstruc, …)
casm.qewrapper.read_settings(filename) Returns a JSON object reading JSON files containing settings for Quantum Espresso PBS jobs.
casm.qewrapper.write_settings(settings, filename) Write ‘settings’ as json file, ‘filename’

casm.quantumespresso

casm.quantumespresso.FreezeError() Quantum Espresso appears frozen
casm.quantumespresso.NbandsError() Your highest band is occupied at some k-points! Unless you are
casm.quantumespresso.QuantumEspressoError(msg)
casm.quantumespresso.QuantumEspressoWarning(msg)
casm.quantumespresso.Relax([relaxdir, settings]) The Relax class contains functions for setting up, executing, and parsing a Quantum Espresso relaxation.
casm.quantumespresso.error_check(jobdir, …) Check quantum espresso stdout for errors
casm.quantumespresso.run(infilename, outfilename) Run quantum espresso using subprocess.

casm.quantumespresso.qeio

casm.quantumespresso.qeio.QUANTUM_ESPRESSO_INT_LIST dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_FLOAT_LIST dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_BOOL_LIST dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_STR_LIST dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_TOTAL_LIST dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.For example: dict(one=1, two=2).
casm.quantumespresso.qeio.ControlError(msg)
casm.quantumespresso.qeio.Control(title, …) The Control class contains:
casm.quantumespresso.qeio.SystemError(msg)
casm.quantumespresso.qeio.System(title, …) The Sys class contains:
casm.quantumespresso.qeio.ElectronsError(msg)
casm.quantumespresso.qeio.Electrons(title, …) The Electrons class contains:
casm.quantumespresso.qeio.IonsError(msg)
casm.quantumespresso.qeio.Ions(title, …) The Ions class contains:
casm.quantumespresso.qeio.CellError(msg)
casm.quantumespresso.qeio.Cell(title, …) The Cell class contains:
casm.quantumespresso.qeio.AtomicSpeciesError(msg)
casm.quantumespresso.qeio.AtomicSpecies(…) The AtomicSpecies class contains:
casm.quantumespresso.qeio.AtomicPositionsError(msg)
casm.quantumespresso.qeio.AtomicPositions(…) The AtomicPositions class contains:
casm.quantumespresso.qeio.CellParametersError(msg)
casm.quantumespresso.qeio.CellParameters(…) The CellParameters class contains:
casm.quantumespresso.qeio.KPointsError(msg)
casm.quantumespresso.qeio.KPoints(cardstring) The KPoints class contains:
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_NAMELIST_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_NAMELIST_OBJ_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_CARD_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_CARD_OBJ_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.quantumespresso.qeio.QUANTUM_ESPRESSO_BLOCK_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.quantumespresso.qeio.InfileError(msg)
casm.quantumespresso.qeio.Infile(filename[, …]) The Infile class contains:
casm.quantumespresso.qeio.OutfileError(msg)
casm.quantumespresso.qeio.Outfile(filename) Parse Outfiles.
casm.quantumespresso.qeio.PoscarError(msg)
casm.quantumespresso.qeio.Site(cart, position) Site in a basis.
casm.quantumespresso.qeio.Poscar(filename[, …]) The Poscar class contains:
casm.quantumespresso.qeio.DEFAULT_QE_MOVE_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.quantumespresso.qeio.DEFAULT_QE_COPY_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.quantumespresso.qeio.DEFAULT_QE_REMOVE_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.quantumespresso.qeio.QuantumEspressoIOError(msg)
casm.quantumespresso.qeio.job_complete(…) Return True if Quantum Espresso job at path ‘jobdir’ is complete
casm.quantumespresso.qeio.get_infile_tag(…) Opens Infile in ‘jobdir’ and returns ‘key’ value.
casm.quantumespresso.qeio.set_infile_tag(…) Opens Infile in ‘jobdir’, sets ‘key’ value, and writes Infile If ‘val’ == None, the tag is removed from the Infile.
casm.quantumespresso.qeio.ionic_steps(…[, …]) Find the number of ionic steps completed in ‘jobdir’
casm.quantumespresso.qeio.write_quantum_espresso_input(…) Write Quantum Espresso input files in directory ‘dirpath’
casm.quantumespresso.qeio.SpeciesError(msg)
casm.quantumespresso.qeio.IndividualSpecies(…) The IndividualSpecies class contains:
casm.quantumespresso.qeio.species_settings(…) Returns a dict of IndividualSpecies objects, with keys equal to their names.
casm.quantumespresso.qeio.write_species_settings(…) Write a SPECIES file from a species dict
casm.quantumespresso.qeio.QErunError(msg)
casm.quantumespresso.qeio.QErun(outfilename) An object containing values read from outfile

casm.questwrapper

casm.questwrapper.Relax([configdir, auto, sort]) The Relax class contains functions for setting up, executing, and parsing a SeqQuest relaxation.
casm.questwrapper.QuestWrapperError Errors related to QuestWrapper
casm.questwrapper.read_settings(filename) Returns a JSON object reading JSON files containing settings for seqquest cluster jobs.
casm.questwrapper.write_settings(settings, …) Write ‘settings’ as json file, ‘filename’
casm.questwrapper.quest_input_file_names(…) Collect casm.questwrapper input files from the CASM project hierarchy

casm.seqquest

casm.seqquest.RelaxError Relax-specific errors
casm.seqquest.Relax([relaxdir, settings]) The Relax class contains functions for setting up, executing, and parsing a seqquest calc.
casm.seqquest.SeqQuestError Class for SeqQuest errors
casm.seqquest.SeqQuestWarning Class for SeqQuest warnings
casm.seqquest.continue_job(jobdir, contdir, …) Use the files in seqquest job directory ‘jobdir’, to setup a seqquest job in directory
casm.seqquest.complete_job(jobdir, settings) Remove files from a quest job directory
casm.seqquest.run([jobdir, stdout, stderr, …]) Run seqquest using subprocess.

casm.seqquest.seqquest_io

casm.seqquest.seqquest_io.Cell([POS, …]) Container class for cell data
casm.seqquest.seqquest_io.Geom([POS, …]) Container class for geometry data
casm.seqquest.seqquest_io.Site(position[, …]) Site in a basis.
casm.seqquest.seqquest_io.LcaoIN([filename, …]) Container object for reading, parsing, and writing lcao.in files
casm.seqquest.seqquest_io.LcaoOUT([filename]) Container object for reading and parsing lcao.out files
casm.seqquest.seqquest_io.DEFAULT_QUEST_MOVE_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.seqquest.seqquest_io.DEFAULT_QUEST_COPY_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.seqquest.seqquest_io.DEFAULT_QUEST_REMOVE_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.seqquest.seqquest_io.QUEST_INPUT_FILE_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.seqquest.seqquest_io.SeqquestIO(…[, …]) Generate a set of SeqQuest input files from settings files
casm.seqquest.seqquest_io.get_lcao_tag(keys) Opens lcao.in in ‘jobdir’ and returns ‘key’ value
casm.seqquest.seqquest_io.job_complete([jobdir]) return True if the seqquest job at path ‘jobdir’ is complete
casm.seqquest.seqquest_io.species_settings(…) Returns a dict of IndividualSpecies objects, with keys equal to their names.

casm.vasp

casm.vasp.io Tools for VASP input and output
casm.vasp.VaspError VASP related errors
casm.vasp.VaspWarning(msg) VASP related warnings
casm.vasp.continue_job(jobdir, contdir, settings) Use the files in vasp job directory ‘jobdir’, to setup a vasp job in directory ‘contdir’.
casm.vasp.IbzkptError VERY BAD NEWS! internal error in subroutine IBZKPT
casm.vasp.FEXCFError ERROR FEXCF: supplied exchange-correlation table
casm.vasp.SubSpaceMatrixError WARNING: Sub-Space-Matrix is not hermitian
casm.vasp.InisymError VASP can’t figure out the (magnetic) symmetry
casm.vasp.SgrconError VASP is having yet another symmetry problem
casm.vasp.WavecarError A bad WAVECAR is causing the job to crash/abort
casm.vasp.NbandsError Your highest band is occupied at some k-points! Unless you are
casm.vasp.NoConvergeError An ionic step was performed without a fully-converged density
casm.vasp.FreezeError VASP appears frozen
casm.vasp.error_check(jobdir, stdoutfile, …) Check vasp stdout for errors
casm.vasp.crash_check(jobdir, stdoutfile, …) Check vasp stdout for evidence of a crash
casm.vasp.complete_job(jobdir, settings) Remove files from a vasp job directory
casm.vasp.run([jobdir, stdout, stderr, …]) Run vasp using subprocess.
casm.vasp.Relax([relaxdir, settings]) The Relax class contains functions for setting up, executing, and parsing a VASP relaxation.
casm.vasp.Converge([propdir, settings, prop]) The Converge class contains functions for setting up, executing, and parsing a VASP convergence.

casm.vasp.io

casm.vasp.io.VASP_INPUT_FILE_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.DEFAULT_VASP_MOVE_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.DEFAULT_VASP_COPY_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.DEFAULT_VASP_REMOVE_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.VaspIOError(msg)
casm.vasp.io.job_complete([jobdir]) Return True if vasp job at path ‘jobdir’ is complete
casm.vasp.io.get_incar_tag(key[, jobdir]) Opens INCAR in ‘jobdir’ and returns ‘key’ value.
casm.vasp.io.set_incar_tag(tag_dict[, …]) Opens INCAR in ‘jobdir’, sets ‘key’ value, and writes INCAR If ‘val’ is None, the tag is removed from the INCAR.
casm.vasp.io.ionic_steps([jobdir]) Find the number of ionic steps completed in ‘jobdir’
casm.vasp.io.write_potcar(filename, poscar, …) Write an appropriate POTCAR
casm.vasp.io.write_stopcar([mode, jobdir]) Write STOPCAR file with two modes: mode = ‘e’ for ‘VASP stops at the next electronic step’ mode = ‘i’ for ‘VASP stops at the next ionic step’
casm.vasp.io.write_vasp_input(dirpath, …) Write VASP input files in directory ‘dirpath’
casm.vasp.io.VASP_TAG_INT_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.VASP_TAG_FLOAT_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.VASP_TAG_BOOL_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.VASP_TAG_SITEF_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.VASP_TAG_SPECF_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.VASP_TAG_SPECI_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.VASP_TAG_STRING_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.VASP_TAG_LIST list() -> new empty list list(iterable) -> new list initialized from iterable’s items
casm.vasp.io.IncarError(msg)
casm.vasp.io.Incar(filename[, species, …]) The INCAR class contains:
casm.vasp.io.KpointsError(msg)
casm.vasp.io.Kpoints(filename) The Kpoints class contains:
casm.vasp.io.OutcarError(msg)
casm.vasp.io.Outcar(filename) Parse OUTCAR files.
casm.vasp.io.OszicarError(msg)
casm.vasp.io.Oszicar(filename) Parse OSZICAR files.
casm.vasp.io.Site(cart, position[, SD_FLAG, …]) Site in a basis.
casm.vasp.io.PoscarError(msg)
casm.vasp.io.Poscar(filename[, species, …]) The Poscar class contains:
casm.vasp.io.SpeciesError(msg)
casm.vasp.io.SpeciesDict SpeciesDict subclasses dict so it can hold additional metadata without disrupting routines that
casm.vasp.io.IndividualSpecies(values, tags, …) The IndividualSpecies class contains:
casm.vasp.io.species_settings(filename) Returns a SpeciesDict of IndividualSpecies objects, with keys equal to their names.
casm.vasp.io.write_species_settings(species, …) Write a SPECIES file from a species dict
casm.vasp.io.VaspIO(incarfile, …[, sort]) Generate a set of VASP input files from settings files
casm.vasp.io.VasprunError(msg)
casm.vasp.io.Vasprun(filename[, DOS, Band]) An object containing values read from vasprun.xml

casm.vaspwrapper

casm.vaspwrapper.Relax([configdir, auto, sort]) The Relax class contains functions for setting up, executing, and parsing a VASP relaxation.
casm.vaspwrapper.Converge([configdir, auto, …]) The Converge class contains functions for setting up, executing, and parsing a VASP convergence test.
casm.vaspwrapper.VaspWrapperError(msg)
casm.vaspwrapper.read_settings(filename) Returns a JSON object reading JSON files containing settings for VASP PBS jobs.
casm.vaspwrapper.write_settings(settings, …) Write ‘settings’ as json file, ‘filename’
casm.vaspwrapper.vasp_input_file_names(dir, …) Collect casm.vaspwrapper input files from the CASM project hierarchy

casm.wrapper

casm.wrapper.jobname(configname) Return a name for a submitted job for configuration with ‘configname’