Skip to content

hecss.cli

The command line interface for the HECSS sampler

__all__ = ['hecss_sampler', 'plot_stats', 'plot_bands', 'calculate_xscale', 'reshape_sample', 'dfset_writer', 'xsl_writer'] module-attribute

HECSS

Class encapsulating the sampling and weight generation for the HECSS algorithm.

Create the HECSS sampling object. It is intended to be a single object per crystal cryst used to run samplers for one or more temperatures. The object holds data common to all samplers (structure, calculator etc.). The other parameters are set per sampler. The set of samplers, indexed by temperature is hold inside the HECSS object in the samplers dictionary.

Arguments
  • cryst : crystal structure (ASE Atoms object)
  • calc : ASE calculator or a callable returning a fresh one. A single calculator instance is reused; a callable is invoked once per sampler (i.e. once per temperature).
  • width : eta, displacement scaling parameter, approx 1.0. If None, it is estimated from forces on the first sample() call.
  • maxburn : max. number of initial burn-in samples
  • w_search : use width/eta searching algorithm (default True)
  • disp_dist : use different distribution instead of stats.norm as the displacement distribution.
  • directory : basic calculation directory used by directory based calculators
  • pbar : show progress bar during calculations
Source code in hecss/core.py
class HECSS:
    '''
    Class encapsulating the sampling and weight generation 
    for the HECSS algorithm.

    Create the HECSS sampling object. It is intended to be a single object
    per crystal `cryst` used to run samplers for one or more temperatures.
    The object holds data common to all samplers (structure, calculator etc.).
    The other parameters are set per sampler. The set of samplers, indexed 
    by temperature is hold inside the `HECSS` object in the `samplers` dictionary.

    #### Arguments

    * cryst : crystal structure (ASE `Atoms` object) 
    * calc  : ASE calculator or a callable returning a fresh one. A single
              calculator instance is reused; a callable is invoked once per
              sampler (i.e. once per temperature).
    * width : eta, displacement scaling parameter, approx 1.0. If None, it is
              estimated from forces on the first `sample()` call.
    * maxburn : max. number of initial burn-in samples
    * w_search : use width/eta searching algorithm (default True)
    * disp_dist : use different distribution instead of `stats.norm` 
                   as the displacement distribution.
    * directory : basic calculation directory used by directory based calculators
    * pbar : show progress bar during calculations

    '''


    def __init__(self, cryst, calc, width=None, maxburn=20, w_search=True,
                 disp_dist = 'normal', directory=None, pbar=False):

        self.cryst = cryst
        self.calc = calc
        self.Ep0 = None
        self.maxburn = maxburn
        self.w_search = w_search
        if directory is None :
            self.directory = f'calc'
        else :
            self.directory = directory
        self._eta_list = []
        self._eta_samples = []
        self.w_scale = 1e-3 # Overall scale in w(T) function (Ang/sqrt(K))
        self.eta = width # width = eta * w_scale sqrt(T)
        self.xscale_init = np.ones((len(self.cryst),3))

        self.Q = stats.norm
        try :
            self.Q = _disp_dists[disp_dist]
        except KeyError:
            print(f'Warning: {disp_dist} displacement distribution not supported.\n'
                  'Keeping normal displacement distribution')

        self.pbar = None
        self._pbar = None
        if pbar is not None:
            self.pbar = pbar

        self.samplers = {}

    def smpl_print(self):
        return
        max_r = 15
        if pbar:
            if i==0:
                pbar.set_postfix(Sample='burn-in', n=k, w=w,
                                 dE=f'{(e_star-E_goal)/Es:+6.2f} sigma', 
                                 xs=f'{sqrt(xscale.std()):6.3f}')
            else :
                pbar.set_postfix(xs=f'{sqrt(xscale.std()):6.3f}', config=f'{i:04d}', 
                                 w=w, w_bar=f'{np.mean([_[0] for _ in wl]) if wl else w:7.3f}')
        elif pbar is None :
            if i==0:
                print(f'Burn-in sample {sqrt(xscale.std()):6.3f}:{k}'
                      f'  w:{w:.4f}'
                      f'  dE:{(e_star-E_goal)/Es:+6.2f} sigma', end='\n')
            else :
                print(f'Sample {sqrt(xscale.std()):6.3f}:{n:04d}'
                      f'w:{w:.4f}  <w>:{np.mean([_[0] for _ in wl]) if wl else w:.4f}', end='\n')
            sys.stdout.flush()
        else :
            pass


    def print_xs(self, c, s):
        return
        elmap = c.get_atomic_numbers()
        for el in sorted(set(elmap)):
            print(f'{chemical_symbols[el]:2}: {s[elmap==el,:].mean():8.4f}', end='  ')
        print()

Ep0 = None instance-attribute

Q = _disp_dists[disp_dist] instance-attribute

calc = calc instance-attribute

cryst = cryst instance-attribute

directory = f'calc' instance-attribute

eta = width instance-attribute

maxburn = maxburn instance-attribute

pbar = None instance-attribute

samplers = {} instance-attribute

w_scale = 0.001 instance-attribute

xscale_init = np.ones((len(self.cryst), 3)) instance-attribute

__init__(cryst, calc, width=None, maxburn=20, w_search=True, disp_dist='normal', directory=None, pbar=False)

Source code in hecss/core.py
def __init__(self, cryst, calc, width=None, maxburn=20, w_search=True,
             disp_dist = 'normal', directory=None, pbar=False):

    self.cryst = cryst
    self.calc = calc
    self.Ep0 = None
    self.maxburn = maxburn
    self.w_search = w_search
    if directory is None :
        self.directory = f'calc'
    else :
        self.directory = directory
    self._eta_list = []
    self._eta_samples = []
    self.w_scale = 1e-3 # Overall scale in w(T) function (Ang/sqrt(K))
    self.eta = width # width = eta * w_scale sqrt(T)
    self.xscale_init = np.ones((len(self.cryst),3))

    self.Q = stats.norm
    try :
        self.Q = _disp_dists[disp_dist]
    except KeyError:
        print(f'Warning: {disp_dist} displacement distribution not supported.\n'
              'Keeping normal displacement distribution')

    self.pbar = None
    self._pbar = None
    if pbar is not None:
        self.pbar = pbar

    self.samplers = {}

print_xs(c, s)

Source code in hecss/core.py
def print_xs(self, c, s):
    return
    elmap = c.get_atomic_numbers()
    for el in sorted(set(elmap)):
        print(f'{chemical_symbols[el]:2}: {s[elmap==el,:].mean():8.4f}', end='  ')
    print()

smpl_print()

Source code in hecss/core.py
def smpl_print(self):
    return
    max_r = 15
    if pbar:
        if i==0:
            pbar.set_postfix(Sample='burn-in', n=k, w=w,
                             dE=f'{(e_star-E_goal)/Es:+6.2f} sigma', 
                             xs=f'{sqrt(xscale.std()):6.3f}')
        else :
            pbar.set_postfix(xs=f'{sqrt(xscale.std()):6.3f}', config=f'{i:04d}', 
                             w=w, w_bar=f'{np.mean([_[0] for _ in wl]) if wl else w:7.3f}')
    elif pbar is None :
        if i==0:
            print(f'Burn-in sample {sqrt(xscale.std()):6.3f}:{k}'
                  f'  w:{w:.4f}'
                  f'  dE:{(e_star-E_goal)/Es:+6.2f} sigma', end='\n')
        else :
            print(f'Sample {sqrt(xscale.std()):6.3f}:{n:04d}'
                  f'w:{w:.4f}  <w>:{np.mean([_[0] for _ in wl]) if wl else w:.4f}', end='\n')
        sys.stdout.flush()
    else :
        pass

calculate_xscale(supercell, scale, output, skip)

Calculate initial values for amplitude correction coefficients from the scale file data for the specified supercell.

Source code in hecss/cli.py
@click.command()
@click.argument('supercell', type=click.Path(exists=True))
@click.argument('scale', type=click.Path(exists=True))
@click.option('-o', '--output', type=click.Path(), required=True, help='Write output to the file.')
@click.option('-s', '--skip', default=0, type=int, help='Skip this number of samples at the beginning')
@click.version_option(hecss.__version__, '-V', '--version', message=_version_message)
@click.help_option('-h', '--help')
def calculate_xscale(supercell, scale, output, skip):
    '''
    Calculate initial values for amplitude correction coefficients 
    from the scale file data for the specified supercell.
    '''
    sc = ase.io.read(supercell)
    xsl = loadtxt(scale).reshape((-1, len(sc), 3))
    xsi = calc_init_xscale(sc, xsl, skip=skip if skip else None)
    savetxt(output, xsi, fmt='%9.4f')
    print(f'Done. The initial scale saved to: {output}')

dfset_writer(s, sl, workdir='', dfset='', scale='', xsl=None)

Write one sample to the DFSET file in workdir.

s is a sample tuple; sl is unused and exists only to match the sentinel callback signature. If scale and xsl are both set, the accumulated amplitude corrections are appended to the scale file and xsl is cleared. Always returns False, so it can be used as a sampler sentinel.

Source code in hecss/cli.py
def dfset_writer(s, sl, workdir='', dfset='', scale='', xsl=None):
    '''
    Write one sample to the DFSET file in `workdir`.

    `s` is a sample tuple; `sl` is unused and exists only to match the
    sentinel callback signature. If `scale` and `xsl` are both set, the
    accumulated amplitude corrections are appended to the scale file and
    `xsl` is cleared. Always
    returns `False`, so it can be used as a sampler sentinel.
    '''
    wd = Path(workdir)
    write_dfset(f'{wd.joinpath(dfset)}.raw', s)
    _save_xsl(workdir, scale, xsl, sl)
    # Important! Return False to keep iteration going
    return False

hecss_sampler(fname, workdir, label, temp, width, ampl, scale, symprec, calc, setups, nodfset, dfset, nsamples, neta, command, nwork, pbar)

Run HECSS sampler on the structure in the provided file (FNAME). Read the docs at: https://jochym.github.io/hecss/

 FNAME - Supercell structure file. The containing directory must be readable by Vasp(restart). Usually this is a CONTCAR file for a supercell.

Source code in hecss/cli.py
@click.command()
@click.argument('fname', type=click.Path(exists=True))            
@click.option('-W', '--workdir', default="WORK", type=click.Path(exists=True), help="Work directory")
@click.option('-l', '--label', default="hecss", help="Label for the calculations.")
@click.option('-T', '--temp', default=300, type=float, help="Target temperature in Kelvin.")
@click.option('-w', '--width', default=None, type=float, help="Initial scale of the prior distribution")
@click.option('-a', '--ampl', default='', type=click.Path(), help='Initialise amplitude correction from the file.')
@click.option('-s', '--scale', default='', type=click.Path(), help='Save amplitude correction history')
@click.option('-m', '--symprec', default=1e-5, type=float, help='Symmetry search tolerance.')
@click.option('-C', '--calc', default="VASP", type=str, 
              help="ASE calculator to be used for the job. "
                      "Supported calculators: VASP (default)")
@click.option('-S', '--setups', default="guess", type=str,
              help="setups parameter of the calculator to force use of the "
                   "particular variants of pseudopotentials in the calculations. "
                   "By default pseudopotentials are guessed from the POTCAR in "
                   "the supercell directory.")
@click.option('-n', '--nodfset', is_flag=True, default=False, help='Do not write DFSET file for ALAMODE')
@click.option('-d', '--dfset', default='DFSET.dat', help='Name of the DFSET file')
@click.option('-N', '--nsamples', default=10, type=int, help="Number of samples to be generated")
@click.option('-e', '--neta', default=2, type=int,
              help="Number of samples for width scale estimation (ignored when -w is given)")
@click.option('-c', '--command', default='./run-calc', help="Command to run calculator")
@click.option('-k', '--nwork', default=None, type=int, help="Parallel workers for width estimation only (0=unlimited); sampling runs serially")
@click.option('-p', '--pbar/--no-pbar', default=True,
              help="Show or hide the progress bar (shown by default)")
@click.version_option(hecss.__version__, '-V', '--version', message=_version_message)
@click.help_option('-h', '--help')
def hecss_sampler(fname, workdir, label, temp, width, ampl, scale, symprec, calc, setups, nodfset, dfset, nsamples, neta, command, nwork, pbar):
    '''
    Run HECSS sampler on the structure in the provided file (FNAME).\b
    Read the docs at: https://jochym.github.io/hecss/

    \b
    FNAME - Supercell structure file. The containing 
            directory must be readable by Vasp(restart).
            Usually this is a CONTCAR file for a supercell.
    '''

    if not math.isfinite(temp) or temp <= 0:
        print(f'Invalid temperature {temp}. Use a finite value above 0 K.')
        return

    print(f'HECSS ({hecss.__version__})\n'
          f'Supercell:      {fname}\n'
          f'Temperature:    {temp}K\n'
          f'Work directory: {workdir}\n'
          f'Calculator:     {calc}')

    src_path = Path(fname)
    workdir = Path(workdir)
    Ep0 = None
    if calc=="VASP":
        calculator = Vasp(label=label, directory=src_path.parent, restart=True)
        Ep0 = calculator.get_potential_energy()
        cryst = ase.Atoms(calculator.atoms)
        cryst.calc = calculator
        calculator.set(directory=workdir)
        command = Path(command)
        calculator.set(command=f'{shlex.quote(str(command.absolute()))} {shlex.quote(str(label))}')
        calculator.set(nsw=0)
        if setups :
            if setups=='guess':
                setups = {}
                with open(src_path.parent / Path("POTCAR"), "r") as pf:
                    for l in pf.readlines():
                        if "TITEL" in l:
                            l = l.strip().split()[3].split("_")
                            el = l[0]
                            st = ""
                            if len(l)>1:
                                st = f"_{l[1]}"
                            setups[el] = st
                print(f"Setups guessed from {src_path.parent / Path('POTCAR')}: {setups}")
            else :
                if setups in {'recommended', 'minimal', 'gw'}:
                # We do not need to parse these. Just use as is
                    pass
                else :
                # Parse into dict
                    setups = ast.literal_eval(setups)
                print(f"Setups forced: {setups}")
            calculator.set(setups=setups)
    else:
        print(f'The {calc} calculator is not supported.')
        return

    if nodfset:
        # Scale history is still written when -s is requested.
        sentinel = xsl_writer if scale else None
    else:
        sentinel = dfset_writer

    xsl = None
    if scale:
        xsl = []

    wl = []

    sampler = HECSS(cryst, calculator, directory=workdir, width=width, pbar=pbar)
    sampler.Ep0 = Ep0

    if ampl:
        sampler.xscale_init = loadtxt(ampl)

    if width is not None:
        # Explicit width supersedes the default (or requested) estimation.
        neta = 0

    if nsamples < 2 and scale:
        print('Need at least 2 samples (-N 2) to calculate amplitudes (-s).')
        print('Refusing the job.')
        return

    if nsamples < 1:
        print('WARNING: No samples will be generated (N=0)')
        print('Continue with the job')

    if width is None and neta > 0:
        if (workdir/'w_est').exists() :
            print(f'Directory {workdir/"w_est"} exists.')
            print('Make sure you specified correct working directory.')
            print('I refuse to overwrite existing calculations.')
            print(f'Either specify w on the command line, \n'
                  f'or remove w_est directory from {workdir}.')
            if (workdir/'w_est/w_est.dat').exists():
                wm = loadtxt(workdir/'w_est/w_est.dat').T
                y = sqrt((3*wm[1]*un.kB)/(2*wm[2]))
                print(f'Width scale from {workdir/"w_est/w_est.dat"} data: {y.mean():.3g}+/-{y.std():.3g}')
            return
        print('Estimating width scale.')
        eta, sigma, xscale = sampler.estimate_width_scale(neta, Tmin=temp/2, Tmax=temp, pbar=sampler._pbar, nwork=nwork)
        if nsamples < 2:
            print(f'Width scale from {neta} pts.: {eta:.3g}+/-{sigma:.3g}')
            print('Width scale estimation run (N<2). Not running sampling.')
            return

    if (workdir/f"T_{temp:.1f}K").exists():
        print(f'Directory {workdir/f"T_{temp:.1f}K"} exists.')
        print('Make sure you specified correct working directory.')
        print('I refuse to overwrite existing calculations.')
        print(f'Correct your workdir or move {workdir/f"T_{temp:.1f}K"} to a different location.')
        return

    if not nodfset:
        df_path = workdir / dfset
        if df_path.exists():
            old_t = None
            with df_path.open() as df:
                for line in df:
                    if line.startswith('## T='):
                        try:
                            old_t = float(line[5:])
                        except ValueError:
                            pass
            if old_t is not None and not math.isclose(old_t, temp, abs_tol=1e-6):
                print(f'WARNING: {df_path} already contains data for T={old_t:.1f} K; '
                      f'appending data for T={temp:.1f} K.')

    print('Sampling configurations')
    samples = sampler.sample(temp, nsamples,
                             width_list=wl, 
                             sentinel=sentinel,
                             sentinel_args={'workdir': f'{workdir}/T_{temp:.1f}K/',
                                              'dfset': dfset,
                                              'scale': scale,
                                              'xsl': xsl
                                             },
                             xscale_list=xsl,
                             symprec=symprec)
    if not samples:
        print('No samples generated (N<1).')
        return
    # generate distribution centered at mean energy
    T_m = 2*array([s[-1] for s in samples]).mean()/3/un.kB
    print(f'Generating distribution centered at: {T_m:.3f} K')
    distr = sampler.generate(samples, T_m)
    if len(wl)>1 :
        wl = array(wl).T
        # print(wl.shape)
        print(f'Average width scale ({len(wl[0])} pnts): {wl[0].mean():.3g}+/-{wl[0].std():.3g}')

    if not nodfset:
        wd = Path(workdir)
        for i, s in enumerate(distr):
            write_dfset(f'{wd.joinpath(dfset)}', s,
                        comment=f'T={temp:.1f}' if i == 0 else '')

    return

plot_bands(bands, output, x, sixel, width, height, label, nodecor)

Plot the phonon dispersion from the file generated by ALAMODE. Optionally write out the plot to the output graphics file.

Source code in hecss/cli.py
@click.command()
@click.argument('bands', type=click.Path(exists=True), nargs=-1)
@click.option('-s', '--sixel', is_flag=True, help='Use SixEl driver for terminal graphics.')
@click.option('-n', '--nodecor', is_flag=True, help='Decorate the plot.')
@click.option('-w', '--width', type=float, default=6, help='Width of the figure.')
@click.option('-h', '--height', type=float, default=4, help='Height of the figure.')
@click.option('-o', '--output', type=click.Path(), default="", 
              help='Write output to the file.')
@click.option('-l', '--label', type=str, default="", 
              help='Label(s) for the plot. Comma-separated list')
@click.option('-x', is_flag=True, default=False, 
              help='Make plot in an interactive window')
@click.version_option(hecss.__version__, '-V', '--version', message=_version_message)
def plot_bands( bands, output, x, sixel, width, height, label, nodecor):
    """
    Plot the phonon dispersion from the file generated by ALAMODE.
    Optionally write out the plot to the output graphics file.
    """
    import matplotlib.pylab as plt

    import hecss.monitor as hm


    plt.figure(figsize=(float(width), float(height)))

    ll = label.split(',')
    if len(ll) < len(bands):
        cp = os.path.commonpath(bands)
        rpl = [p[len(cp):][::-1] for p in bands]
        cs = os.path.commonpath(rpl)
        ll = [p[len(cp):-len(cs)] for p in bands]

    for b, l in zip(bands, ll):
        p = Path(b)

        hm.plot_bands_file(p, lbl=l, decorate=not nodecor)

    if label or len(bands)>1:
        plt.legend()

    if output:
        plt.savefig(output)
    if sixel:
        try :
            import sixelplot
        except ImportError:
            print('SixEl graphics support not installed. Install sixelplot package.')
            return
        sixelplot.show()

plot_stats(dfset, t, output, x, sixel, sqrn, width, height)

Plot the statistics of the samples from the DFSET file. Use T(K) as a reference target temperature. Optionally write out the plot to the output graphics file.

Source code in hecss/cli.py
@click.command()
@click.argument('dfset', type=click.Path(exists=True))
@click.argument('T', default=-1, type=float)
@click.option('-n', '--sqrn', is_flag=True, help='Show sqrt(N) bars on the histogram.')
@click.option('-s', '--sixel', is_flag=True, help='Use SixEl driver for terminal graphics.')
@click.option('-w', '--width', type=float, default=6, help='Width of the figure.')
@click.option('-h', '--height', type=float, default=4, help='Height of the figure.')
@click.option('-o', '--output', type=click.Path(), default="", help='Write output to the file.')
@click.option('-x', is_flag=True, default=False, help='Make plot in an interactive window')
@click.version_option(hecss.__version__, '-V', '--version', message=_version_message)
def plot_stats( dfset, t, output, x, sixel, sqrn, width, height):
    """
    Plot the statistics of the samples from the DFSET file.
    Use T(K) as a reference target temperature. Optionally 
    write out the plot to the output graphics file.
    """
    import matplotlib.pylab as plt

    from hecss.monitor import plot_stats
    from hecss.util import load_dfset

    p = Path(dfset)
    smpl = load_dfset(p)
    plt.figure(figsize=(float(width), float(height)))
    plot_stats(smpl, T=t if t >0 else None, sqrN=sqrn, show=x)
    if output:
        plt.savefig(output)
    if sixel:
        try :
            import sixelplot
        except ImportError:
            print('SixEl graphics support not installed. Install sixelplot package.')
            return
        sixelplot.show()

reshape_sample(dfset, t, nmul, prob, w, check, b, output, d)

Reshape the sample to the normal distribution centered around mean energy (temperature), or around provided temperature T (Kelvin). The reshaping is done by adjusting weighting of the samples by repeating the ones which should be up-weighted. The parameters are the variants of the weighting algorithm (see the docs).

The procedure reads and produces a file with in the DFSET format. For the 'check' function to work the parameter must point to the root directory of the calculated samples. The checked directories will be in the form: '{root}/nnnn'.

In check mode the raw file is not reshaped, just filtered.

Source code in hecss/cli.py
@click.command()
@click.argument('dfset', type=click.Path(exists=True))
@click.argument('T', default=-1, type=float)
@click.option('-N', '--nmul', default=4, type=int, help="Sample length multiplier (default: 4)")
@click.option('-p', '--prob', type=float, default=0.25, help='Probability treshold (default: 0.25)')
@click.option('-w', is_flag=True, default=True, help='Force non-zero weights for samples above probability treshold. (default: True)')
@click.option('-b', is_flag=True, default=False, help='Border samples account for the rest of domain')
@click.option('-c', '--check', type=click.Path(), default="", help='Check and skip unconverged samples in calc directory.')
@click.option('-o', '--output', type=click.Path(), required=True, help='Write output to the file.')
@click.option('-d', is_flag=True, default=False, help='Plot debug plots')
@click.version_option(hecss.__version__, '-V', '--version', message=_version_message)
def reshape_sample(dfset, t, nmul, prob, w, check, b, output, d):
    '''
    Reshape the sample to the normal distribution centered around mean energy (temperature),
    or around provided temperature T (Kelvin). The reshaping is done by adjusting weighting
    of the samples by repeating the ones which should be up-weighted. 
    The parameters are the variants of the weighting algorithm (see the docs).\b

    The procedure reads and produces a file with in the DFSET format.
    For the 'check' function to work the parameter must point to the root directory 
    of the calculated samples. The checked directories will be in the form: '{root}/nnnn'.  

    In check mode the raw file is *not* reshaped, just filtered.
    '''
    from hecss.util import load_dfset
    p = Path(dfset)
    smpl = load_dfset(p)

    if check :
        from tqdm.auto import tqdm
        print(f"Checking convergence in {check}/nnnn")
        configs = {i for n, i, x, f, e in smpl}
        converged = {i for i in tqdm(configs)
                     if Vasp(restart=True, directory=f'{check}/{i:04d}').converged}
        print(f"Number of converged calculations: {len(converged)}/{len(configs)}")
        dist = [s for s in smpl if s[1] in converged]
        print(f"Rewriting the raw dfset (skipping reshape).")
    else :
        if t < 0:
            t = 2*array([s[-1] for s in smpl]).mean()/3/un.kB 
        dist = make_sampling(smpl, t, border=b, probTH=prob, Nmul=nmul, nonzero_w=w, debug=d)
        print(f'Done. Distribution reshaped to {t:.2f} K.')

    print(f'Done. Saving to: {output}')
    for s in dist:
        write_dfset(output, s)

xsl_writer(s, sl, workdir='', dfset='', scale='', xsl=None)

Append amplitude corrections to the scale file without writing DFSET data.

Used as the sampler sentinel when --nodfset is combined with --scale. s, sl and dfset are unused; they match the sentinel callback signature. Always returns False to keep sampling going.

Source code in hecss/cli.py
def xsl_writer(s, sl, workdir='', dfset='', scale='', xsl=None):
    """Append amplitude corrections to the scale file without writing DFSET data.

    Used as the sampler sentinel when ``--nodfset`` is combined with
    ``--scale``. `s`, `sl` and `dfset` are unused; they match the sentinel
    callback signature. Always returns `False` to keep sampling going.
    """
    _save_xsl(workdir, scale, xsl, sl)
    return False