pyextal.jaxJoint.settings

Every option of a joint refinement, in one place.

A joint refinement is a list of jaxGeo.RefineSettings, one per dataset, that agree on the options deciding the shared parameters and the schedule of the one optimiser (JOINT_FIELDS). JointSettings holds the options common to all datasets in common and each dataset’s departures from them in datasets; JointSettings.resolved merges the two and checks them.

Attributes

Classes

JointSettings

Options for jaxJoint.refine.refine.

Functions

display_names(paths)

Short names that tell the datasets apart.

_as_dict(entry)

Module Contents

pyextal.jaxJoint.settings.JOINT_FIELDS = ('symmetry', 'imag', 'layers', 'refine_layers', 'steps', 'warmup', 'lr', 'geometry',...
pyextal.jaxJoint.settings.WEIGHTINGS = ('pixels', 'equal')
pyextal.jaxJoint.settings.display_names(paths)

Short names that tell the datasets apart.

The file stem when the stems differ. Otherwise the first path component, counting up from the file, that differs between the datasets, without the prefix they all share up to its last _, - or space – so .../STO_..._30pA_R5/refinement/STO_001.h5 and .../STO_..._30pA_R4/ refinement/STO_001.h5 become R5 and R4.

Parameters:

paths (sequence) – Dataset paths.

Returns:

list[str]

pyextal.jaxJoint.settings._as_dict(entry)
class pyextal.jaxJoint.settings.JointSettings

Options for jaxJoint.refine.refine.

Parameters:
  • common (RefineSettings) – Options every dataset starts from, including all of JOINT_FIELDS.

  • datasets (sequence) – One entry per dataset: a dict of the fields that differ from common (at least h5), a full RefineSettings, or just the dataset path.

  • names (sequence, optional) – Display names; default display_names.

  • weighting – 'pixels' weights each dataset’s mean chi^2 by its number of data points, so the loss is the chi^2 of all of them pooled; 'equal' averages the datasets’ chi^2; a sequence gives explicit relative weights.

  • out_dir (Path, optional) – Where the joint summary goes; default the first dataset’s folder.

common: pyextal.jaxGeo.settings.RefineSettings
datasets: Tuple = ()
names: Tuple[str, ...] | None = None
weighting: str | Tuple[float, ...] = 'pixels'
out_dir: pathlib.Path | None = None
resolved()

Checks the options and returns a canonical copy.

Returns:

common resolved, datasets as a tuple of resolved RefineSettings, names filled in and weighting as ‘pixels’, ‘equal’ or a tuple of floats.

Return type:

JointSettings

Raises:

SetupError – On an inconsistent option, a dataset setting a joint field, or the same file twice.