bsmart package

Subpackages

Submodules

bsmart.BSMArtBlackBox module

bsmart.BSMArtBlackBox.get_blackbox(file, args_dict=None, post_process=None, likelihood_return_type='Likelihood')[source]

bsmart.BSMlikelihood module

Basic functions related to likelihoods, given here for convenience for scans that want them

bsmart.BSMlikelihood.C_interval(val, lower, upper)[source]

Non-log version corresponding to LogC_interval.

bsmart.BSMlikelihood.Clog_interval(val, lower, upper)[source]

Like C_interval, but with log-scaled values. WARNING: val, lower, upper must be strictly positive numbers.

bsmart.BSMlikelihood.LogBias(val, m, s)[source]
bsmart.BSMlikelihood.LogC_function(val, m, s)[source]

m is mean, s is variance, so lower = m-s, upper = m+s

Gives a value between -1 * max log and 0; looks very much like a LL

bsmart.BSMlikelihood.LogC_interval(val, lower, upper)[source]

Log C-function based on an interval [lower, upper] where:

  • If both bounds finite: closed interval [lower, upper]

  • If only lower is given: [lower, +inf[

  • If only upper is given: ]-inf, upper]

  • If neither is given: always inside (zero penalty)

Returns 0.0 inside the allowed region and a negative log10(1 + distance) penalty outside.

bsmart.BSMlikelihood.LogClog_function(val, m, s)[source]

Like LogC_function, but with log-scaled values. WARNING: val, m - s must be strictly positive numbers.

bsmart.BSMlikelihood.LogClog_interval(val, lower, upper)[source]

Like LogC_interval, but with log-scaled values. WARNING: val, lower, upper must be strictly positive numbers.

bsmart.BSMlikelihood.LogGauss(val, m, s)[source]
bsmart.BSMlikelihood.LogSigmoid(val, s)[source]
bsmart.BSMlikelihood.MakeGlobalLikelihood(observables_dict: dict, user_loglike: bool = False, return_type: str = None, max_loss: float = None, smooth_losses: bool = True)[source]

Makes a function that takes a list of observables and outputs a global likelihood Also returns a ‘mask’ list corresponding to whether a given observable is ignored or not; useful for machine-learning tasks.

This seems to work ok. I wonder whether it would be safer to wrap it into a class that stores the functions?

user_loglike is a legacy feature. If True it will use log likelihoods; if False it will use regular likelihoods.

The idea will be that the user tells the code what to provide to give a likelihood. So if what is provided is a log likelihood, they should provide EXPUSER; if it is an NLL it should be MINUSEXPUSER. This may then be undone by the requirements of the scan.

return_type should be:

“Likelihood” (A likelihood), by default “LL” (Log Likelihood) “NLL” (Negative Log Likelihood)

smooth_losses is True by default. If true, then the function will always return a number (it should not raise an error if some observables are infinite or NaN), and in the case of log likelihoods the value is capped at max_loss.

max_loss is optional and only relevant for LL and NLL methods and when smooth_losses is True. It will cap the loss at this value (if provided), smoothing using a sigmoid. Otherwise a maximum value corresponding to 710.782712893384 ( = math.log(1+sys.float_info.max) + 1 on a standard system ) is used.

bsmart.BSMlikelihood.MakeLikelihoodFunc(scaling, mean, var, lower_bound=None, upper_bound=None, log_scaling=False)[source]
bsmart.BSMlikelihood.MakeLikelihoodFuncLog(scaling, mean, var, lower_bound=None, upper_bound=None, log_scaling=False)[source]
bsmart.BSMlikelihood.MakeLikelihoods(observables_dict, loglike: bool = False)[source]

returns a list of likelihood functions and masks (for variables that should be ignored by the likelihood computation)

bsmart.BSMlikelihood.SafeExp(val)[source]
bsmart.BSMlikelihood.SafeLog(val)[source]
bsmart.BSMlikelihood.Sigmoid(val, s)[source]
bsmart.BSMlikelihood.bias(val, m, s)[source]
bsmart.BSMlikelihood.gauss(val, m, s)[source]
bsmart.BSMlikelihood.logL(val, m, s)[source]
bsmart.BSMlikelihood.safe_float(x)[source]

Convert x to float if possible, else return NaN.

bsmart.BSMlikelihood.smooth_cap_loss(x, maxloss)[source]

Caps the loss by applying a sigmoid. This is useful for losses that are unbounded.

bsmart.BSMplots module

Routines to automatically generate simple plots using matplotlib

Function make_plots takes the scan as argument

In the settings the plots to be produced should just be pairs of variables and observables, or the ‘result’. But the result is not actually stored in the point in the RunManager … only in the csv/spectrum file etc.

We could have three strategies: 1) Take the points directly from the store in the runner in the_scan.RunManager.all_points or the_scan.RunManager.valid_points (not necessarily always there for every scan) 2) Read from csv file using pandas (easiest) 3) Read from the output_file which stores all spectrum files if the appropriate option is set

For other things (e.g. using only the selected points in an MCMC scan) this is scan dependent and we can’t be sure how or where the results are stored.

It would be useful to write a script that generates the

bsmart.BSMplots.getfrominput(no)[source]
bsmart.BSMplots.getfromoutput(no)[source]
bsmart.BSMplots.make_auto_corner_csv(namestub, csvfile, shorts, plotdict)[source]
bsmart.BSMplots.make_fancy_auto_corner_csv(namestub, csvfile, shorts, plotdict)[source]
bsmart.BSMplots.make_plot(xlabel, ylabel, x, y, name, xlim, ylim, plotdict={})[source]
bsmart.BSMplots.make_plots(the_scan)[source]
bsmart.BSMplots.make_script_csv(xshort, yshorts, xlabel, ylabel, csvfile, namestub, xlim, ylim, plotdict={})[source]
bsmart.BSMplots.make_script_zslha(plotstub, plot, the_scan)[source]
bsmart.BSMplots.say_hello(the_scan)[source]

bsmart.BSMutil module

Some simple utilities that can be used either in the scans or in external programs

So far this includes routines for scaling up and down variables. To invoke them, use

Import BSMutil

in your scan.

Then

bsmart.BSMutil.create_scalers(inputs, log=None)[source]
bsmart.BSMutil.downscaler_capped(vmin, vmax)[source]

Uniform prior on the interval [0,1] but raises an error if outside

bsmart.BSMutil.downscaler_func(vmin, vmax)[source]

Inverse of uniform prior, maps [vmin,vmax] -> [0,1]

bsmart.BSMutil.downscaler_logprior(vmin, vmax)[source]

x = log(y/vmin)/log(vmax/vmin)

bsmart.BSMutil.downscaler_open(vmin, vmax)[source]

Rescale a range onto [0,1] but allow values outside

bsmart.BSMutil.downscaler_symlinear(vmin, vmax)[source]

Inverse of Map [0.5,1] -> [|vmin|,|vmax|] and [0,0.5] -> [-|vmax|,-|vmin|] This should be a disjoint interval.

bsmart.BSMutil.downscaler_symlog(vmin, vmax)[source]

Inverse of Map [0.5,1] -> vmin *exp (x*log(vmax/vmin)) and [0,0.5] -> - vmin *exp (x*log(vmax/vmin)) This should be a disjoint interval. _box = log(y/vmin)/log(vmax/vmin) _box = 2x -1 x = (_box + 1)/2

bsmart.BSMutil.upscaler_capped(vmin, vmax)[source]

Uniform prior on the interval [0,1] but raises an error if outside

bsmart.BSMutil.upscaler_cauchyprior(vmin, vmax, pmean, psigma)[source]
bsmart.BSMutil.upscaler_expprior(vmin, vmax, psigma)[source]

P(y) ~ e^y. Coincides with MultiNest version when vmin = -infty, vmax=0, psigma > 0 or vmin=infty, vmax=0, psigma < 0

bsmart.BSMutil.upscaler_func(vmin, vmax)[source]

Uniform prior on [0,1] -> [vmin,vmax]

bsmart.BSMutil.upscaler_gaussprior(vmin, vmax, pmean, psigma)[source]
bsmart.BSMutil.upscaler_lognormalprior(vmin, vmax, pmean, psigma)[source]
bsmart.BSMutil.upscaler_logprior(vmin, vmax)[source]

Thanks to Luc Darme

bsmart.BSMutil.upscaler_open(vmin, vmax)[source]

Rescale a range onto [0,1] but allow values outside

bsmart.BSMutil.upscaler_sinprior(vmin, vmax)[source]
bsmart.BSMutil.upscaler_symlinear(vmin, vmax)[source]

Map [0.5,1] -> [|vmin|,|vmax|] and [0,0.5] -> [-|vmax|,-|vmin|] This should be a disjoint interval.

bsmart.BSMutil.upscaler_symlog(vmin, vmax)[source]

_box = 2 * box - 1 _sign = np.sign(_box) _exp = low + np.abs(_box) * (high - low) return float(_sign * 10**_exp)

Map [0.5,1] -> vmin *exp (x*log(vmax/vmin)) and [0,0.5] -> - vmin *exp (x*log(vmax/vmin)) This should be a disjoint interval.

avmin = min(abs(vmin),abs(vmax)) avmax = max(abs(vmin),abs(vmax))

diff = avmax-avmin

bsmart.HEPRun module

HEPRun class for handling running and IO with HEP tools.

Part of BSMArt, but it is self-contained (nb requires zslha and the classes for the different tools) and you can import it into your own programs

In that case the useful classes are:

HEPRun (which manages everything) CoreRunner (which manages running on one core) DataPoint

You can use HEPRun to run batches of points (using multiprocessing!) or CoreRunner.run_point(point) to run individual points

This is useful for MPI running mode, where the multiprocessing is handled outside the program.

Allowed settings in the input dictionary (“Setup” block unless otherwise specified):
  • RunName: Name of the run.

  • Cores: Number of cores to use.

  • TempDir: Temporary working directory.

  • debug: Enable debug mode (boolean).

  • SLHA_Output: Boolean, control SLHA output generation.

  • Skip SLHA Files: Boolean, for pure python scans (skips I/O).

  • Output File: Name for collected outputs.

  • Spectrum File: Name for intermediate spectrum file.

  • StoreInputs: Boolean, whether to store input Les Houches files.

  • StoreAllPoints: Boolean, whether to store all points (default True).

  • Store Output Files: Boolean, alias for StoreAllPoints.

  • Short: Boolean, enable tabbed output.

  • csv: Boolean, enable CSV output.

  • csv name: Name for the CSV file.

  • Precision: Integer, precision for observables.

  • Store Invalid: Boolean, store invalid points.

  • Store In Memory: Boolean, store DataPoint objects in memory.

  • StoreSeparateFiles: Boolean, store separate spectrum files.

  • StoreEverything: Boolean, retain all inputs and outputs for each point.

  • Use TQDM: Boolean, use tqdm progress bar.

Other blocks:
  • Codes: Dictionary of codes to run.

  • Observables: Dictionary of observables.

  • Variables: Dictionary of variables.

  • Derived Variables: Dictionary of derived variables.

  • Fitting: Dictionary for fitting inputs.

  • MPI: Dictionary containing MPI settings (Size, Rank).

class bsmart.HEPRun.CoreRunner(ParentRunner, name)[source]

Bases: object

Class to handle running on one core, takes HEPRun as parent, which becomes the self.RunHandler

do_marginalisation(point_container)[source]
run_all(run_queue, sample_start, sample_size, Lock=None, pbar=None)[source]

Runs points from a list; usually invoked by run_batch in the RunHandler.

run_point(Point=None, ID=None, lock=None)[source]

Run a single point: create LH file, set codes to work on it; uses a single core for this If ID is None, we assume we are running in single core mode

Point is just a list of floats corresponding to the input variables.

class bsmart.HEPRun.DataPoint(ID: int, inputs: list = None)[source]

Bases: object

Class to hold info about each point. We need at least an ID.

A list of inputs is the first step to filling. observables are a list of floats outputs are a list of results from the computation, intended to be returned to the scan. E.g. a likelihood valid is whether the point passes validity checks etc

clear_obs()[source]
get_all_dict() dict[source]
get_var_dict(var_names: list = None)[source]
make_var_dict(var_names: list)[source]
to_dict(all_data: bool = False)[source]

Creates a dictionary representation. If all_data is True, we export the spc object too

class bsmart.HEPRun.HEPRun(runsettings: RunSettings = None, write_inputfile: Callable = None, postprocess: Callable = None, log: Logger = None, inputs: dict | OrderedDict = {})[source]

Bases: object

This is the main class to handle running.

all_tools_run_state(state=True)[source]
new_point_to_stack(inputs)[source]
newpoint(inputs)[source]
run_batch(sample)[source]
set_tool_run_state(tool, state=True)[source]
set_up_codes()[source]

Set up the HEP Tools needed in the scan

set_up_marginalisation()[source]
class bsmart.HEPRun.HepTool(name, settings, global_settings=None)[source]

Bases: object

Template class to run the different HEP tools Codes are supposed to place their output in spc_file which will get read at the end

At init we may also provide global settings so that the code can take what they need (e.g. number of cores) These should not be stored by default

But they may want access at intermediate stages to things like the input variables or details of the spectrum. For that we can use the DataPoint class

launch(spc_file, temp_dir, log, data_point)[source]
run(spc_file, log)[source]
validity_check(obs_dict)[source]
class bsmart.HEPRun.RunSettings(inputs: str | dict | OrderedDict = None)[source]

Bases: object

Container class to store settings to be passed to the running module Ordinarily these are filled in in core.py

bsmart.HEPRun.UpdateProgress(number, length, message='', finish=False)[source]

Ridiculously basic progress bar Implemented here so that we don’t need to install extra packages

If tqdm is installed, you can use it in this function. See the example below: from tqdm import tqdm

with tqdm(total=length) as pbar:
for i in range(number):

# Do stuff… pbar.update()

bsmart.HEPRun.create_condition(cond_string)[source]
bsmart.HEPRun.create_smart_format(precision)[source]
bsmart.HEPRun.create_validator(obs, range)[source]
bsmart.HEPRun.format_variable(value)[source]

bsmart.core module

BSMArt Core module to define the basic Scan class

All scans inherit the basic features here.

Useful settings:

‘StoreEverything’: will store all output from all codes in separate directories in All_Outputs ‘StoreAllPoints’: Keep all points. Default is to concatenate them into one file stored in Results ‘StoreSeparateFiles’: Separate the resulting spectrum files, stored in Results ‘Store In Memory’: Store all the points in memory during running; useful for plotting and for user-defined scans (defualt False) ‘Output File’: name for output file collecting spectra/csv/tabbed output ‘Spectrum File’: name for the spectrum file. Only really used internally ‘Merge Results’ : Merge the spectrum/csv files if MPI operation is used, also for MCMC Results. ‘csv’ : Store results in a csv file

class bsmart.core.Scan(inputs, log)[source]

Bases: object

Parent Scan class from which all child NewScan classes are born

configure_input_spc()[source]

We store a template input spectrum file and use zslha to write our input files for different codes by default. However, the user can overload write_lh_file or setlhvals as necessary if a different format is needed

finish_scan()[source]
initialise()[source]

method to allow the user scan to overload run settings etc during the initialisation process

launch()[source]
lhcommonsusyscale(mSUSY)[source]

sets a common SUSY scale for use with low scale input

lhsetSUSY(m0, m12, T0)[source]

Sets common SUSY soft scalar masses, gaugino masses and stop trilinear

lhsetSUSYScalars(m0)[source]
lhsetcommonspheno()[source]

Sets useful sphenooptions

lhsetdiagonal(block, val)[source]

sets the given block to a diagonal value val

make_dirs()[source]

Create output and inputs directories

postprocess(Point, observables, data_point, temp_dir, log, lock=None)[source]

Default postprocessing method for use with SLHA output, you should overload this for more interesting/sophisticated scans

postprocess_no_slha(Point, observables, data_point, temp_dir, log, lock=None)[source]

Default postprocessing method for use without SLHA output, you should overload this for more interesting/sophisticated scans

By default I will take this to be the

run()[source]
setlhvals(point, values_dict=None)[source]
start_scan()[source]
varnames

## now setup the run manager self.runsettings=RunSettings(inputs[‘Setup’][‘RunName’]) self.runsettings.cores=inputs[‘Setup’][‘Cores’] self.runsettings.work_dir=inputs[‘Setup’][‘TempDir’] self.runsettings.debug=eval(inputs[‘Setup’][‘debug’]) self.runsettings.packagepath=inputs[‘Setup’][‘PackagePath’]

self.runsettings.no_slha_output=False

self.resume = eval(inputs[‘Setup’].get(‘Resume’,”False”))

if inputs[‘MPI’][‘Size’] > 1:

self.runsettings.use_MPI=True

if ‘SLHA_Output’ in inputs[‘Setup’]:

self.runsettings.no_slha_output=not eval(str(inputs[‘Setup’][‘SLHA_Output’]))

if ‘Codes’ not in inputs:

self.log.error(‘No codes found in input file’) raise SystemExit

else:

self.runsettings.codes=inputs[‘Codes’]

### add observables defined within the code to the global observables list if present for code in inputs[‘Codes’]:

if eval(inputs[‘Codes’][code][‘Run’]) and ‘Observables’ in inputs[‘Codes’][code]:
for obs in inputs[‘Codes’][code][‘Observables’]:

inputs[‘Observables’][obs] = inputs[‘Codes’][code][‘Observables’][obs]

if ‘StoreInputs’ in inputs[‘Setup’]:

self.runsettings.store_inputs=eval(str(inputs[‘Setup’][‘StoreInputs’]))

else:

self.runsettings.store_inputs=False

if ‘Short’ in inputs[‘Setup’]:

self.runsettings.tabbed_output = eval(str(inputs[‘Setup’][‘Short’]))

if ‘csv’ in inputs[‘Setup’]:

self.runsettings.csv_output = eval(str(inputs[‘Setup’][‘csv’]))

if ‘csv name’ in inputs[‘Setup’]:

self.runsettings.csv_name=str(inputs[‘Setup’][‘csv name’])

if ‘Precision’ in inputs[‘Setup’]:

self.runsettings.precision = int(inputs[‘Setup’][‘Precision’])

if ‘StoreAllPoints’ in self.inputs[‘Setup’]:

self.runsettings.store_outputs=eval(self.inputs[‘Setup’][‘StoreAllPoints’])

else:

self.runsettings.store_outputs=True

if ‘Store In Memory’ in self.inputs[‘Setup’]:

self.runsettings.store_points=eval(self.inputs[‘Setup’][‘Store In Memory’])

if ‘StoreSeparateFiles’ in self.inputs[‘Setup’]:

self.runsettings.store_separate_files=eval(str(self.inputs[‘Setup’][‘StoreSeparateFiles’]))

self.runsettings.store_everything=False if ‘StoreEverything’ in self.inputs[‘Setup’]:

self.runsettings.store_everything=eval(str(self.inputs[‘Setup’][‘StoreEverything’])) if self.runsettings.store_everything:

self.runsettings.store_outputs=True; if inputs[‘MPI’][‘Size’] > 1:

self.runsettings.all_dir=os.path.join(self.inputs[‘Setup’][‘cwd’], self.inputs[‘Setup’][‘RunName’],’All_Outputs’,’MPI_’+str(inputs[‘MPI’][‘Rank’]))

else:

self.runsettings.all_dir=os.path.join(self.inputs[‘Setup’][‘cwd’], self.inputs[‘Setup’][‘RunName’], ‘All_Outputs’)

if inputs[‘MPI’][‘Size’] > 1:

self.runsettings.inputs_dir = os.path.join(self.inputs[‘Setup’][‘cwd’], self.inputs[‘Setup’][‘RunName’], ‘Input_Files’,’MPI_’+str(inputs[‘MPI’][‘Rank’])) self.runsettings.output_dir = os.path.join(self.inputs[‘Setup’][‘cwd’], self.inputs[‘Setup’][‘RunName’],’Spectrum_Files’,’MPI_’+str(inputs[‘MPI’][‘Rank’]))

else:

self.runsettings.inputs_dir = os.path.join(self.inputs[‘Setup’][‘cwd’], self.inputs[‘Setup’][‘RunName’], ‘Input_Files’) self.runsettings.output_dir = os.path.join(self.inputs[‘Setup’][‘cwd’], self.inputs[‘Setup’][‘RunName’], ‘Spectrum_Files’)

self.runsettings.output_filename=’SLHA_output’ if ‘Output File’ in self.inputs[‘Setup’]:

self.runsettings.output_filename=self.inputs[‘Setup’][‘Output File’]

if ‘Spectrum File’ in self.inputs[‘Setup’]:

self.runsettings.spc_filename=self.inputs[‘Setup’][‘Spectrum File’]

else:

self.runsettings.spc_filename=’SLHA_output’

## the input file should be the input for the first code that we run, presumably SPheno. Note we imported the json as an OrderedDict firstcode=next(iter(self.inputs[‘Codes’])) self.runsettings.input_filename=self.inputs[‘Codes’][firstcode][‘InputFile’] if ‘Variables’ in self.inputs:

self.runsettings.variables=self.inputs[‘Variables’] self.varnames = list(self.inputs[‘Variables’].keys()) self.runsettings.varnames=self.varnames

else:

self.runsettings.variables=None self.varnames=None self.runsettings.varnames=None

if ‘Derived Variables’ in self.inputs:
“””

Allow for functions of the variables, which should be provided as a dictionary like {“dvar1”: “math.exp(mh)”, …} These will be treated like variables when writing the input files etc, but won’t show up in the csv file

“”” self.runsettings.derived_variables = self.inputs[‘Derived Variables’]

if ‘Observables’ in self.inputs:

self.runsettings.observables=self.inputs[‘Observables’]

if ‘Fitting’ in self.inputs:

self.runsettings.fitting_inputs=self.inputs[‘Fitting’]

write_citations()[source]
write_lh_file(point, dir, name, values_dict=None, Overloads=None)[source]

write Les Houches input file for given parameter point

bsmart.debug module

Debugging routines modified from xBit by F. Staub

bsmart.debug.command_line_log(command, log, ctimeout=None)[source]

Execute commands in a shell, logging both the command and any errors. 22/07/2024: discard the output of stdout since we never use it.

bsmart.debug.command_line_log_PID(command, wdir, log)[source]
bsmart.debug.new_core_logger(debug, name, file)[source]

Create the logger for the core running: we don’t need to write much from the console in this case, keep it in the files. Otherwise we clutter the screen with lots of error messages.

bsmart.debug.new_logger(debug, name, file)[source]

Create the logger for scans

bsmart.debug.noshell_command_log_PID(command, wdir, log)[source]
bsmart.debug.onecore_command_log(command, log, ctimeout=None)[source]
bsmart.debug.print_BSMArt_splash()[source]

bsmart.dmlimits module

Code to perform very basic direct detection DM limits using interpolation based on data scraped from plots.

This should ultimately be upgraded. But in any case it is largely unneeded because MicrOMEGAs can compute its own p-value.

class bsmart.dmlimits.DMlimits[source]

Bases: object

DMexclusion(Mdm, Oh2, SI, SDp, SDn)[source]
excludefile(filename)[source]

open file omg.out and read in the relevant lines, then return exclusion (or not) as 1 or 0

bsmart.marginalisation module

bsmart.marginalisation.chisq(mean, err)[source]
bsmart.marginalisation.create_chisquare_marginal(inputs, log=None)[source]
bsmart.marginalisation.create_diff_marginal(inputs, log=None)[source]
bsmart.marginalisation.create_scalers_marginal(inputs, log=None)[source]
bsmart.marginalisation.diff_for_brentq(mean, err)[source]
bsmart.marginalisation.downscaler_func_infty(vmin, vmax)[source]
bsmart.marginalisation.find_a_sign_change(mindiff, max_safe_val, func, sols, start, end, ffa, ffb, minx=None, miny=None)[source]

Function is supposed to return a large value if unsafe, so we use max_safe_val

bsmart.marginalisation.oned_usebrentq(func, ranges, log, options={})[source]

Takes a function with argument a 1D list for compatibility reasons

bsmart.marginalisation.upscaler_func_infty(vmin, vmax)[source]

bsmart.zslha module

class bsmart.zslha.SLHA(spc: SLHA | None = None)[source]

Bases: object

BR(init, final)[source]
Value(block, number)[source]

return value of a parameter defined by block and entry or the width or an BR

Width(pdg)[source]
add(extra_spc)[source]
flush()[source]

store the information once a block is completely parsed

from_dict(indict)[source]
safeValue(block, number, returnval=0.0)[source]
safeValue2(block, number, returnval=[0.0, 0.0])[source]
start_block(li)[source]
start_decay(li)[source]
start_xsection(li)[source]
to_dict()[source]
write(filename: str, append: bool = False)[source]

Write all data to an SLHA file. Here we do not attempt to evaluate strings Takes a filename as argument By default will overwrite Optional argument to append to the file instead

bsmart.zslha.read(file, separator=None, verbose=False, firstblock=None)[source]

file: SLHA file separator: e.g. ENDOFPARAMETERPOINT, in order to have multiple spectrum files concatenated into one verbose: for extra info firstblock: NEW, for reading only everything after a certain input, when e.g. it has been

appended to a file (e.g. HiggsBounds, Vevacious)

bsmart.zslha.read_dir(dir, entries=None)[source]
bsmart.zslha.read_small(file, entries, sep)[source]
bsmart.zslha.write(blocks, filename)[source]
bsmart.zslha.write_block_entries(values, file)[source]
bsmart.zslha.write_block_head(name, file)[source]
bsmart.zslha.write_block_numbers(name, values, var_dict, file, comments={})[source]
bsmart.zslha.write_les_houches(block, values, point, file)[source]
bsmart.zslha.write_lh(spc, var_vals, filename, var_names=None)[source]
bsmart.zslha.write_lh_dict(spc, var_dict, filename)[source]

Module contents

bsmart.get_bsmart_config_dir(create_dir=False)[source]

Returns the path to the BSMArt configuration directory. Order of preference: 1. Virtual Environment: sys.prefix/etc/BSMArt/ 2. User Config: XDG_CONFIG_HOME/BSMArt/ (e.g. ~/.config/BSMArt/)

bsmart.get_heptools_path_file(create_dir=False)[source]