cryspy-print

Last updated: October 16, 2026

cryspy-print Command

From v1.5.0, cryspy-print lets you inspect pickle files under data/pkl_data/. It replaces CrySPY Utility’s print_pkl.py, displaying contents or a summary according to the file type. For rslt_data.pkl, it also supports sorting by energy, selecting rows, filtering by composition, and regenerating result files.

Usage and Options

cryspy-print infile [options]

The input file can be specified with a relative or absolute path. Gzip-compressed files are also supported. The file type is determined by its filename, so keep names such as rslt_data.pkl unchanged.

Argument or optionDescription
infilePickle file to display. Gzip-compressed files, such as rslt_data.pkl.gz, are also accepted.
--no-sortDisplay rslt_data.pkl in its stored row order without sorting.
--head NDisplay the first N rows after filtering and sorting. N must be a positive integer.
--tail NDisplay the last N rows after filtering and sorting. N must be a positive integer.
--allDisplay all rows after filtering and sorting.
-c N [N ...], --composition N [N ...]Filter EA-vc results in rslt_data.pkl by composition ratio, specified in atype order.
--writeRegenerate ./data/cryspy_rslt and ./data/cryspy_rslt_energy_asc from rslt_data.pkl.
-h, --helpShow help.

--no-sort, --head, --tail, --all, --composition, and --write are options for rslt_data.pkl. --head, --tail, and --all cannot be combined. --write cannot be combined with display options.

Supported Files and Output

FileOutput
input_data.pklInput settings grouped by section. Fields whose value is None are omitted.
init_struc_data.pkl, opt_struc_data.pkl, struc_step_data.pkl, elite_struc.pkl, init_dscrpt_data.pkl, opt_dscrpt_data.pklNumber of stored entries (Number of structures). Structure IDs are not listed.
rslt_data.pklResults table, sorted by energy in ascending order by default.
hdist_data.pklLatest generation and its number of structures. Prints No hull distance data if empty.
pd_data.pklLatest generation and its numbers of stable entries and all entries. Prints No phase diagram data if empty.
cn_comb_data.pklCharge-neutrality settings and the number of charge-neutral combinations. Reports when cn_comb is None.

The contents of the following files are pretty-printed.

  • Common: id_queueing.pkl, id_running.pkl, energy_step_data.pkl, force_step_data.pkl, stress_step_data.pkl, kpt_data.pkl, rng_state_data.pkl
  • EA: gen.pkl, ea_info.pkl, ea_origin.pkl, elite_fitness.pkl
  • EA-vc: nat_data.pkl
  • BO: n_selection.pkl, id_select_hist.pkl, bo_mean.pkl, bo_var.pkl, bo_score.pkl
  • LAQA: tot_step_select.pkl, laqa_energy.pkl, laqa_bias.pkl, laqa_score.pkl, laqa_step.pkl, laqa_struc.pkl

An unsupported filename causes an error.

Examples

Checking Structure Counts, Input Settings, and Fitness

cryspy-print ./data/pkl_data/init_struc_data.pkl

Output for a file containing ten entries:

Number of structures: 10

opt_struc_data.pkl and elite_struc.pkl also display the structure count. To inspect individual structures, use the -p option of cryspy-extract-struc.

cryspy-print ./data/pkl_data/input_data.pkl
cryspy-print ./data/pkl_data/elite_fitness.pkl

input_data.pkl displays settings grouped into sections such as [basic] and [structure]. elite_fitness.pkl displays a dictionary of structure IDs and fitness values.

Displaying Results

cryspy-print ./data/pkl_data/rslt_data.pkl

Results are sorted in ascending order of Ef_eV_atom if that column exists, or E_eV_atom otherwise. All rows are displayed if there are at most 100 rows. For larger tables, the command displays the count and sort order, followed by the first 100 rows.

cryspy-print ./data/pkl_data/rslt_data.pkl --head 10
cryspy-print ./data/pkl_data/rslt_data.pkl --tail 5
cryspy-print ./data/pkl_data/rslt_data.pkl --all

These display the first ten rows, last five rows, or all rows of the table sorted by energy in ascending order. Use --no-sort to keep the stored row order. It can be combined with row selection.

cryspy-print ./data/pkl_data/rslt_data.pkl --no-sort --head 10

Filtering EA-vc Results by Composition

cryspy-print ./data/pkl_data/rslt_data.pkl -c 1 2 --head 10

This selects structures with a composition ratio of 1:2 in atype order and displays the first ten rows in ascending energy order. Atom counts such as (1, 2) and (2, 4) match the same ratio. Specify one non-negative integer per element, with at least one positive value. This option requires EA-vc results with a Num_atom column. A message is displayed if no structures match.

For an example with output, see Tutorial > EA-vc > Check Results > Checking Results for a Specific Composition.

Inspecting Gzip-Compressed Files

cryspy-print ./data/pkl_data/rslt_data.pkl.gz --head 10

The file is read without decompression beforehand. Other supported files can also be supplied in gzip-compressed form.

Regenerating Result Files

Run the following in the calculation directory containing cryspy.in.

cryspy-print ./data/pkl_data/rslt_data.pkl --write

This regenerates the following files, overwriting existing files.

  • ./data/cryspy_rslt: Results in their stored row order.
  • ./data/cryspy_rslt_energy_asc: Results sorted by Ef_eV_atom in ascending order, or E_eV_atom if the former column is absent.

Files are written to data/ under the directory where the command is run. This directory must exist. The operation is also recorded in log_cryspy.