diff --git a/cmdstanpy/cmdstan_args.py b/cmdstanpy/cmdstan_args.py index 997df668..c1b22978 100644 --- a/cmdstanpy/cmdstan_args.py +++ b/cmdstanpy/cmdstan_args.py @@ -273,6 +273,10 @@ def compose(self, idx: int, cmd: list[str]) -> list[str]: cmd.append(f'window={self.adapt_metric_window}') if self.adapt_step_size is not None: cmd.append('term_buffer={}'.format(self.adapt_step_size)) + if self.adapt_engaged: + cmd.append('save_metric=1') + # End adapt subsection + if self.num_chains > 1: cmd.append('num_chains={}'.format(self.num_chains)) diff --git a/cmdstanpy/stanfit/mcmc.py b/cmdstanpy/stanfit/mcmc.py index 7fa27bac..58cc0831 100644 --- a/cmdstanpy/stanfit/mcmc.py +++ b/cmdstanpy/stanfit/mcmc.py @@ -31,7 +31,7 @@ stancsv, ) -from .metadata import InferenceMetadata +from .metadata import InferenceMetadata, MetricInfo from .runset import RunSet @@ -81,6 +81,7 @@ def __init__( # info from CSV values, instantiated lazily self._draws: np.ndarray = np.array(()) # only valid when not is_fixed_param + self._metric_type: str | None = None self._metric: np.ndarray = np.array(()) self._step_size: np.ndarray = np.array(()) self._divergences: np.ndarray = np.zeros(self.runset.chains, dtype=int) @@ -92,6 +93,8 @@ def __init__( # info from CSV header and initial and final comment blocks config = self._validate_csv_files() self._metadata: InferenceMetadata = InferenceMetadata(config) + self._chain_metric_info: list[MetricInfo] = [] + self._metric_info_parsed: bool = False if not self._is_fixed_param: self._check_sampler_diagnostics() @@ -216,11 +219,13 @@ def metric_type(self) -> str | None: to CmdStan arg 'metric'. When sampler algorithm 'fixed_param' is specified, metric_type is None. """ - return ( - self._metadata.cmdstan_config['metric'] - if not self._is_fixed_param - else None - ) + if self._is_fixed_param: + return None + + if not self._metric_info_parsed: + self._parse_metric_info() + + return self._metric_type @property def inv_metric(self) -> np.ndarray | None: @@ -230,10 +235,15 @@ def inv_metric(self) -> np.ndarray | None: a ``nchains x nparams x nparams`` array when metric_type is 'dense_e', or ``None`` when metric_type is 'unit_e' or algorithm is 'fixed_param'. """ - if self._is_fixed_param or self.metric_type == 'unit_e': + if self._is_fixed_param: + return None + + if not self._metric_info_parsed: + self._parse_metric_info() + + if self.metric_type == 'unit_e': return None - self._assemble_draws() return self._metric @property @@ -242,8 +252,13 @@ def step_size(self) -> np.ndarray | None: Step size used by sampler for each chain. When sampler algorithm 'fixed_param' is specified, step size is None. """ - self._assemble_draws() - return self._step_size if not self._is_fixed_param else None + if self._is_fixed_param: + return None + + if not self._metric_info_parsed: + self._parse_metric_info() + + return self._step_size @property def thin(self) -> int: @@ -382,6 +397,27 @@ def _validate_csv_files(self) -> dict[str, Any]: self._max_treedepths[i] = drest['ct_max_treedepth'] return dzero + def _parse_metric_info(self) -> None: + """Extracts metric type, inv_metric, and step size information from the + parsed metric JSONs.""" + self._chain_metric_info = [ + MetricInfo.from_json(mf, chain_id) + for mf, chain_id in zip( + self.runset.metric_files, self.runset.chain_ids + ) + ] + metric_types = {cmi.metric_type for cmi in self._chain_metric_info} + if len(metric_types) != 1: + raise ValueError("Inconsistent metric types found across chains") + self._metric_type = self._chain_metric_info[0].metric_type + self._metric = np.asarray( + [cmi.inv_metric for cmi in self._chain_metric_info] + ) + self._step_size = np.asarray( + [cmi.stepsize for cmi in self._chain_metric_info] + ) + self._metric_info_parsed = True + def _check_sampler_diagnostics(self) -> None: """ Warn if any iterations ended in divergences or hit maxtreedepth. @@ -424,13 +460,11 @@ def _assemble_draws(self) -> None: dtype=np.float64, order='F', ) - self._step_size = np.empty(self.chains, dtype=np.float64) - mass_matrix_per_chain = [] for chain in range(self.chains): try: ( - comments, + _, header, draws, ) = stancsv.parse_comments_header_and_draws( @@ -443,20 +477,11 @@ def _assemble_draws(self) -> None: draws_np = np.empty((0, n_cols)) self._draws[:, chain, :] = draws_np - if not self._is_fixed_param: - ( - self._step_size[chain], - mass_matrix, - ) = stancsv.parse_hmc_adaptation_lines(comments) - mass_matrix_per_chain.append(mass_matrix) except Exception as exc: raise ValueError( f"Parsing output from {self.runset.csv_files[chain]} failed" ) from exc - if all(mm is not None for mm in mass_matrix_per_chain): - self._metric = np.array(mass_matrix_per_chain) - assert self._draws is not None def summary( diff --git a/cmdstanpy/stanfit/metadata.py b/cmdstanpy/stanfit/metadata.py index da322f1e..555f3068 100644 --- a/cmdstanpy/stanfit/metadata.py +++ b/cmdstanpy/stanfit/metadata.py @@ -1,10 +1,16 @@ """Container for metadata parsed from the output of a CmdStan run""" +from __future__ import annotations + import copy +import json +import math import os -from typing import Any, Iterator +from typing import Any, Iterator, Literal +import numpy as np import stanio +from pydantic import BaseModel, Field, field_validator, model_validator from cmdstanpy.utils import stancsv @@ -79,3 +85,53 @@ def stan_vars(self) -> dict[str, stanio.Variable]: These are the user-defined variables in the Stan program. """ return self._stan_vars + + +class MetricInfo(BaseModel): + """Structured representation of HMC-NUTS metric information, + as output by CmdStan""" + + chain_id: int = Field(gt=0) + stepsize: float + metric_type: Literal["diag_e", "dense_e", "unit_e"] + inv_metric: np.ndarray + + model_config = {"arbitrary_types_allowed": True} + + @field_validator("inv_metric", mode="before") + @classmethod + def convert_inv_metric(cls, v: Any) -> np.ndarray: + return np.asarray(v) + + @field_validator("stepsize") + @classmethod + def validate_stepsize(cls, v: float) -> float: + if not math.isnan(v) and v <= 0: + raise ValueError("stepsize must be greater than 0 or NaN") + return v + + @model_validator(mode="after") + def validate_inv_metric_shape(self) -> MetricInfo: + if ( + self.metric_type in ("diag_e", "unit_e") + and self.inv_metric.ndim != 1 + ): + raise ValueError( + "inv_metric must be 1D for diag_e and unit_e metric type" + ) + if self.metric_type == "dense_e": + if self.inv_metric.ndim != 2: + raise ValueError("Dense inv_metric must be 2D") + if self.inv_metric.shape[0] != self.inv_metric.shape[1]: + raise ValueError("Dense inv_metric must be square") + + return self + + @classmethod + def from_json(cls, file: str | os.PathLike, chain_id: int) -> MetricInfo: + """Parse and validate a metric json given a file path and chain_id""" + with open(file) as f: + info_dict = json.load(f) + + info_dict['chain_id'] = chain_id + return cls.model_validate(info_dict) # type: ignore diff --git a/cmdstanpy/stanfit/runset.py b/cmdstanpy/stanfit/runset.py index 3764b8c2..bbfb2f74 100644 --- a/cmdstanpy/stanfit/runset.py +++ b/cmdstanpy/stanfit/runset.py @@ -57,6 +57,7 @@ def __init__( self._stdout_files, self._profile_files = [], [] self._csv_files, self._diagnostic_files = [], [] self._config_files = [] + self._metric_files = [] # per-process output files if one_process_per_chain and chains > 1: @@ -87,6 +88,10 @@ def __init__( # per-chain output files if chains == 1: self._csv_files = [self.gen_file_name(".csv")] + if args.method == Method.SAMPLE: + self._metric_files = [ + self.gen_file_name(".json", extra="metric") + ] if args.save_latent_dynamics: self._diagnostic_files = [ self.gen_file_name(".csv", extra="diagnostic") @@ -95,6 +100,20 @@ def __init__( self._csv_files = [ self.gen_file_name(".csv", id=id) for id in self._chain_ids ] + if args.method == Method.SAMPLE: + if one_process_per_chain: + self._metric_files = [ + os.path.join( + self._outdir, + f"{self._base_outfile}_{id}_metric.json", + ) + for id in self._chain_ids + ] + else: + self._metric_files = [ + self.gen_file_name(".json", extra="metric", id=id) + for id in self._chain_ids + ] if args.save_latent_dynamics: self._diagnostic_files = [ self.gen_file_name(".csv", extra="diagnostic", id=id) @@ -222,6 +241,11 @@ def profile_files(self) -> list[str]: """List of paths to CmdStan profiler files.""" return self._profile_files + @property + def metric_files(self) -> list[str]: + """List of paths to CmdStan NUTS-HMC sampler metric files.""" + return self._metric_files + def gen_file_name( self, suffix: str, *, extra: str = "", id: int | None = None ) -> str: diff --git a/cmdstanpy/utils/stancsv.py b/cmdstanpy/utils/stancsv.py index f8aee8bd..c088c029 100644 --- a/cmdstanpy/utils/stancsv.py +++ b/cmdstanpy/utils/stancsv.py @@ -103,44 +103,6 @@ def csv_bytes_list_to_numpy( return out -def parse_hmc_adaptation_lines( - comment_lines: list[bytes], -) -> tuple[float | None, npt.NDArray[np.float64] | None]: - """Extracts step size/mass matrix information from the Stan CSV comment - lines by parsing the adaptation section. If the diag_e metric is used, - the returned mass matrix will be a 1D array of the diagnoal elements, - if the dense_e metric is used, it will be a 2D array representing the - entire matrix, and if unit_e is used then None will be returned. - - Returns a (step_size, mass_matrix) tuple""" - step_size, mass_matrix = None, None - - cleaned_lines = (ln.lstrip(b"# ") for ln in comment_lines) - in_matrix_block = False - diag_e_metric = False - matrix_lines = [] - for line in cleaned_lines: - if in_matrix_block and line.strip(): - # Stop when we get to timing block - if line.startswith(b"Elapsed Time"): - break - matrix_lines.append(line) - elif line.startswith(b"Step size"): - _, ss_str = line.split(b" = ") - step_size = float(ss_str) - elif line.startswith(b"Diagonal") or line.startswith(b"Elements"): - in_matrix_block = True - elif line.startswith(b"No free"): - break - elif b"diag_e" in line: - diag_e_metric = True - if matrix_lines: - mass_matrix = csv_bytes_list_to_numpy(matrix_lines) - if diag_e_metric and mass_matrix.shape[0] == 1: - mass_matrix = mass_matrix[0] - return step_size, mass_matrix - - def extract_key_val_pairs( comment_lines: list[bytes], remove_default_text: bool = True ) -> Iterator[tuple[str, str]]: @@ -346,67 +308,6 @@ def column_count(ln: bytes) -> int: ) -def raise_on_invalid_adaptation_block(comment_lines: list[bytes]) -> None: - """Throws ValueErrors if the parsed adaptation block is invalid, e.g. - the metric information is not present, consistent with the rest of - the file, or the step size info cannot be processed.""" - - def column_count(ln: bytes) -> int: - return ln.count(b",") + 1 - - ln_iter = enumerate(comment_lines, start=2) - metric = None - for _, line in ln_iter: - if b"metric =" in line: - _, val = line.split(b" = ") - metric = val.replace(b"(Default)", b"").strip().decode() - if b"Adaptation terminated" in line: - break - else: # No adaptation block found - raise ValueError("No adaptation block found, expecting metric") - - if metric is None: - raise ValueError("No reported metric found") - # At this point iterator should be in the adaptation block - - # Ensure step size exists and is valid float - num, line = next(ln_iter) - if not line.startswith(b"# Step size"): - raise ValueError( - f"line {num}: expecting step size, found:\n\t \"{line.decode()}\"" - ) - _, step_size = line.split(b" = ") - try: - float(step_size.strip()) - except ValueError as exc: - raise ValueError( - f"line {num}: invalid step size: {step_size.decode()}" - ) from exc - - # Ensure mass matrix valid - num, line = next(ln_iter) - if metric == "unit_e": - return - if not ( - (metric == "diag_e" and line.startswith(b"# Diagonal elements of ")) - or (metric == "dense_e" and line.startswith(b"# Elements of inverse")) - ): - raise ValueError( - f"line {num}: invalid or missing mass matrix specification" - ) - - # Validating mass matrix shape - _, line = next(ln_iter) - num_unconstrained_params = column_count(line) - if metric == "diag_e": - return - for (num, line), _ in zip(ln_iter, range(1, num_unconstrained_params)): - if column_count(line) != num_unconstrained_params: - raise ValueError( - f"line {num}: invalid or missing mass matrix specification" - ) - - def parse_timing_lines( comment_lines: list[bytes], ) -> dict[str, float]: @@ -489,7 +390,6 @@ def parse_sampler_metadata_from_csv( and header and not is_sneaky_fixed_param(header) ): - raise_on_invalid_adaptation_block(comments) max_depth: int = config["max_depth"] # type: ignore max_tree_hits, divs = extract_max_treedepth_and_divergence_counts( header, draws, max_depth, num_warmup diff --git a/pyproject.toml b/pyproject.toml index dabe44be..fb5c0a1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ readme = "README.md" license = { text = "BSD-3-Clause" } authors = [{ name = "Stan Dev Team" }] requires-python = ">=3.10" -dependencies = ["pandas", "numpy>=1.21", "tqdm", "stanio>=0.4.0,<2.0.0"] +dependencies = ["pandas", "numpy>=1.21", "tqdm", "stanio>=0.4.0,<2.0.0", "pydantic"] dynamic = ["version"] classifiers = [ "Programming Language :: Python :: 3", diff --git a/test/data/logistic_output_1_metric.json b/test/data/logistic_output_1_metric.json new file mode 100644 index 00000000..67b7d03e --- /dev/null +++ b/test/data/logistic_output_1_metric.json @@ -0,0 +1,6 @@ + +{ + "stepsize" : 0.82296841508129293, + "metric_type" : "diag_e", + "inv_metric" : [ 0.047463090328577061, 0.050351054427227954 ] +} diff --git a/test/data/logistic_output_2_metric.json b/test/data/logistic_output_2_metric.json new file mode 100644 index 00000000..7ba30e0c --- /dev/null +++ b/test/data/logistic_output_2_metric.json @@ -0,0 +1,6 @@ + +{ + "stepsize" : 0.80723664360220015, + "metric_type" : "diag_e", + "inv_metric" : [ 0.043061277646603849, 0.055466639648440334 ] +} diff --git a/test/data/logistic_output_3_metric.json b/test/data/logistic_output_3_metric.json new file mode 100644 index 00000000..c4ac26ba --- /dev/null +++ b/test/data/logistic_output_3_metric.json @@ -0,0 +1,6 @@ + +{ + "stepsize" : 0.77878893921149328, + "metric_type" : "diag_e", + "inv_metric" : [ 0.047900911429023758, 0.06720219760749839 ] +} diff --git a/test/data/logistic_output_4_metric.json b/test/data/logistic_output_4_metric.json new file mode 100644 index 00000000..e3c37c8d --- /dev/null +++ b/test/data/logistic_output_4_metric.json @@ -0,0 +1,6 @@ + +{ + "stepsize" : 0.85214264077664958, + "metric_type" : "diag_e", + "inv_metric" : [ 0.047588440045735959, 0.061979369732888139 ] +} diff --git a/test/data/runset-big/output_icar_nyc-1_metric.json b/test/data/runset-big/output_icar_nyc-1_metric.json new file mode 100644 index 00000000..b0063c77 --- /dev/null +++ b/test/data/runset-big/output_icar_nyc-1_metric.json @@ -0,0 +1,5 @@ +{ + "stepsize" : 0.0494777, + "metric_type" : "diag_e", + "inv_metric" : [ 0.643031, 0.519075, 0.586867, 0.666371, 0.539063, 0.849427, 0.484085, 0.431249, 0.493203, 0.56726, 0.483021, 0.591262, 0.494797, 0.700781, 0.515346, 0.512114, 0.484482, 0.618606, 0.495111, 0.473419, 0.48188, 0.598745, 0.588991, 0.545591, 0.684224, 0.594231, 0.494721, 0.54083, 0.515994, 0.509737, 0.48807, 0.659943, 0.638762, 0.522593, 0.502696, 0.56897, 0.548403, 0.722409, 0.521243, 0.516512, 0.581543, 0.501697, 0.439962, 0.523702, 0.643868, 0.646935, 0.504122, 0.513705, 0.571031, 0.507738, 0.511815, 0.489995, 0.497727, 0.572751, 0.505216, 0.59638, 0.54433, 0.61019, 0.428331, 0.586721, 0.485808, 0.511934, 0.598443, 0.643096, 0.54717, 0.760829, 0.590642, 0.5463, 0.514715, 0.718779, 0.513248, 0.751089, 0.574853, 0.69279, 0.574102, 0.806628, 0.621332, 0.613921, 0.631727, 0.632773, 0.69514, 0.572125, 0.685852, 0.60139, 0.597689, 0.652958, 0.646011, 0.669242, 0.618257, 0.733, 0.687093, 0.724731, 0.755907, 0.602023, 0.688886, 0.733624, 0.699098, 1.40632, 0.67792, 0.613119, 0.618322, 0.690308, 0.641379, 0.748825, 1.26119, 0.792162, 0.722881, 0.912656, 0.61615, 0.708002, 0.600301, 0.780701, 0.598119, 0.733717, 0.872601, 0.801774, 0.57583, 1.25404, 0.603809, 0.95112, 0.641736, 0.892457, 0.748016, 1.08146, 0.625063, 1.12557, 0.606828, 0.992523, 0.584844, 1.07034, 0.593139, 1.07598, 0.579005, 0.726634, 0.685541, 0.609054, 1.05796, 0.605918, 0.594703, 1.16256, 0.576953, 0.622027, 1.36227, 0.697746, 0.752361, 1.12634, 0.491017, 1.5328, 0.630876, 1.4758, 0.665893, 0.637766, 1.58814, 0.669498, 0.740122, 1.6703, 0.799325, 0.780515, 1.72442, 0.538021, 1.73333, 0.737493, 1.74434, 0.653641, 1.82473, 0.728365, 1.91105, 0.683943, 1.81634, 0.603459, 1.90163, 0.732483, 0.94443, 1.80524, 1.84828, 0.701145, 1.86224, 0.60569, 1.85907, 0.632324, 1.73605, 0.637898, 1.67371, 0.719358, 1.57459, 0.666776, 1.32628, 0.71509, 1.56977, 0.687807, 1.03286, 0.714011, 1.29284, 0.680072, 0.844727, 1.07138, 0.657097, 1.05385, 0.692748, 1.17308, 0.868413, 1.09862, 1.26407, 0.689981, 1.12369, 0.692489, 0.883919, 0.590953, 0.994198, 0.735078, 0.949425, 0.795629, 0.781927, 0.868865, 0.814496, 1.00949, 0.808555, 0.824072, 0.865984, 1.10942, 1.46667, 0.752266, 1.20189, 0.80468, 1.08515, 0.891558, 1.16195, 0.790697, 0.859559, 0.790707, 1.07877, 0.844394, 0.849743, 0.767861, 0.66732, 1.03743, 0.508965, 0.548102, 1.07798, 1.09794, 0.606607, 1.26383, 0.803834, 1.15446, 1.29564, 1.39901, 1.27428, 1.25275, 1.14901, 0.76408, 0.738735, 1.33054, 1.21592, 1.17864, 1.70271, 1.29833, 1.19616, 1.19791, 1.20904, 1.44119, 1.23669, 1.27968, 1.56426, 1.25571, 1.07897, 1.21495, 1.25271, 1.31224, 0.953763, 1.27292, 1.5003, 1.0782, 0.779669, 1.01974, 0.636787, 0.68463, 0.701787, 0.589947, 0.805436, 0.82094, 0.84073, 0.929715, 0.891685, 0.664302, 0.737688, 0.719953, 0.802832, 0.797992, 0.936838, 0.684545, 0.801607, 0.781902, 0.761839, 0.751322, 0.692138, 0.877097, 0.680928, 0.907028, 0.897104, 0.543264, 0.712753, 1.06638, 0.661742, 0.809188, 0.831762, 0.59109, 0.721949, 0.695125, 0.567958, 0.85538, 0.752346, 0.807589, 0.736147, 0.828797, 0.797966, 0.688121, 0.666256, 0.816105, 0.86473, 0.701879, 0.721551, 0.757922, 0.803402, 0.669679, 0.695787, 0.977066, 0.685778, 0.901582, 0.705728, 0.663315, 0.621231, 0.761955, 0.559011, 0.652278, 0.710597, 0.733877, 0.603098, 0.684785, 0.859078, 0.624778, 0.780175, 0.820838, 0.565276, 0.703473, 0.658464, 0.662725, 1.08355, 0.733557, 0.851651, 0.725046, 0.736288, 0.902216, 0.707774, 0.750213, 1.02145, 0.795039, 0.838218, 0.93779, 0.768095, 0.738146, 0.91556, 0.785875, 0.753513, 0.661652, 1.14099, 0.732823, 0.91668, 0.630774, 0.999168, 0.779645, 0.747664, 0.776692, 0.812538, 0.89765, 0.725838, 0.760657, 0.739734, 0.708236, 0.69621, 0.727937, 0.874015, 0.758959, 0.791144, 0.850455, 0.851537, 0.674042, 0.906244, 0.720238, 0.693267, 0.746167, 0.633461, 0.657201, 0.691517, 0.795104, 0.806923, 0.674014, 0.777863, 0.904439, 0.780803, 0.682834, 0.710718, 0.849418, 0.764417, 0.917707, 0.742579, 0.759592, 0.882016, 0.774382, 0.82323, 0.671982, 0.733017, 0.747043, 0.656585, 0.758142, 0.851138, 0.711794, 0.667623, 0.722355, 0.982967, 0.808519, 0.957178, 0.678145, 0.85807, 0.784321, 0.771095, 0.901392, 0.775246, 0.86393, 0.794378, 0.824985, 0.842657, 0.81521, 0.828157, 1.00064, 0.868364, 0.826602, 1.01749, 0.954509, 0.837878, 0.644349, 0.858941, 0.644368, 0.868601, 0.757367, 0.833001, 0.826934, 1.01722, 0.771841, 0.910568, 0.786517, 0.796405, 0.880802, 0.83663, 0.940816, 0.874537, 0.953309, 0.739771, 1.01557, 1.10678, 0.967281, 0.847795, 0.882565, 1.29242, 1.25992, 1.00862, 1.46712, 0.885691, 0.96688, 0.935839, 1.30605, 1.10864, 1.13961, 1.33374, 0.999545, 0.754669, 1.32656, 0.784885, 1.38114, 0.803451, 1.20407, 1.77906, 1.38744, 1.38691, 0.73629, 1.57045, 1.23622, 1.65364, 2.38095, 1.61393, 1.77263, 0.975553, 1.0391, 1.07987, 0.962532, 0.912683, 1.72002, 0.868496, 0.863547, 0.940319, 1.0131, 1.2175, 1.09011, 1.54818, 1.21657, 1.80538, 0.989318, 0.969784, 0.92682, 2.34941, 1.09017, 2.0711, 0.947555, 1.00546, 1.6988, 1.14445, 1.05885, 0.679247, 1.02382, 0.823857, 0.819119, 1.02969, 0.84854, 0.710126, 0.768238, 1.07724, 0.795315, 0.797286, 1.09686, 0.884216, 0.974462, 0.819163, 1.06757, 0.947758, 1.28285, 1.23774, 0.825607, 1.15832, 0.916271, 1.11848, 0.832977, 0.881101, 0.88041, 1.11906, 0.933959, 1.2229, 0.979014, 1.18501, 0.889294, 1.41047, 0.785694, 1.54332, 0.751771, 1.32732, 0.802777, 1.28639, 0.857536, 0.999829, 0.92854, 0.973019, 1.06166, 0.915425, 1.34943, 1.08265, 1.05411, 1.36554, 1.0152, 0.910998, 1.52316, 0.924795, 1.11468, 1.13786, 1.90875, 1.28335, 1.84218, 1.20025, 1.52955, 1.14452, 1.44954, 1.37521, 1.45931, 1.47802, 1.40967, 1.63873, 1.54108, 1.70518, 1.5546, 1.49379, 1.5825, 1.69342, 1.94524, 1.69752, 1.757, 3.94844, 2.67078, 2.29642, 2.21507, 1.45462, 1.33079, 1.29734, 1.41952, 1.20248, 1.38317, 1.95111, 0.513214, 0.932058, 0.721504, 0.757836, 0.637213, 0.652703, 0.680714, 0.589179, 0.569645, 0.842152, 0.437726, 0.777489, 0.627518, 0.798154, 0.878742, 0.628429, 0.618141, 1.03077, 0.534498, 0.943767, 0.570814, 0.942539, 0.565616, 0.629838, 0.643393, 0.92715, 0.701393, 0.885014, 0.876083, 0.774824, 0.890648, 1.0113, 0.94488, 1.06491, 0.896111, 0.946811, 1.01268, 1.09649, 0.918148, 0.970414, 0.888557, 0.90158, 0.897854, 0.829299, 0.772838, 0.787557, 0.740491, 0.799947, 0.706335, 0.763641, 0.603391, 0.7462, 0.728702, 0.693149, 0.798988, 0.854489, 0.774962, 0.809104, 0.836436, 0.942191, 1.33211, 0.908419, 0.967891, 0.756537, 0.760004, 0.751599, 0.743823, 0.752621, 1.19791, 0.704184, 0.764286, 0.691928, 0.790724, 0.763417, 0.693835, 0.698439, 0.639244, 0.787479, 0.687709, 0.582107, 0.677304, 0.883321, 0.664937, 0.66762, 0.631631, 0.697533, 0.626312, 0.616968, 0.907553, 0.578758, 0.722118, 0.606334, 0.735609, 0.73104, 0.774796, 0.639919, 0.802577, 0.724998, 0.907167, 0.778835, 0.873323, 0.814205, 1.03667, 0.884086, 0.839883, 0.65289, 0.774037, 0.689678, 1.09763, 0.692481, 0.646695, 0.692376, 0.537741, 0.82842, 0.570033, 0.991097, 0.547073, 0.888733, 0.701073, 0.827493, 0.76865, 0.984782, 0.999213, 0.95287, 1.03478, 0.914957, 1.00196, 1.07168, 0.831907, 0.514106, 1.0229, 0.57724, 0.732354, 0.5609, 0.869123, 0.617114, 0.810889, 0.549057, 0.706965, 0.6333, 0.483539, 0.629293, 0.451266, 0.667682, 0.544302, 0.693585, 0.462937, 0.694454, 0.600415, 0.779542, 0.529781, 0.86225, 0.587802, 0.93837, 0.734489, 0.763924, 0.831043, 0.735546, 0.692663, 0.587148, 0.678642, 0.627834, 0.714354, 0.631371, 0.6866, 0.503324, 0.667305, 0.473054, 0.686574, 0.444913, 0.744534, 0.669899, 0.687353, 0.435941, 0.717791, 0.536103, 0.705148, 0.51486, 0.707488, 0.52241, 0.709106, 0.572226, 0.687406, 0.652122, 0.664899, 0.41543, 0.636819, 0.435695, 0.686443, 0.473598, 0.676849, 0.391845, 0.629591, 0.416811, 0.608459, 0.388059, 0.671542, 0.373911, 0.656019, 0.437584, 0.656246, 0.420289, 0.776358, 0.412704, 0.52192, 0.674333, 0.413107, 0.663015, 0.434239, 0.636252, 0.447712, 0.72774, 0.496546, 0.826039, 0.459982, 0.748242, 0.377253, 0.684648, 0.523426, 0.804235, 0.469988, 0.787029, 0.461541, 0.830741, 0.369271, 0.943654, 0.374022, 0.989738, 0.439455, 0.8039, 0.679137, 0.406953, 0.949265, 0.422825, 0.852711, 0.397876, 1.02281, 0.446569, 0.965394, 0.431377, 0.999, 0.441356, 0.844662, 0.458347, 0.82782, 0.456521, 0.9155, 0.510807, 0.943618, 0.532281, 0.974165, 0.413817, 0.827385, 0.467159, 0.807228, 0.527868, 0.476312, 0.450265, 0.916182, 0.58222, 0.495709, 0.480172, 0.486432, 0.529426, 0.534227, 0.587198, 1.02845, 0.487902, 1.16273, 0.472185, 1.04615, 0.51389, 0.569574, 0.656788, 1.01526, 0.578138, 0.500381, 1.15037, 0.48752, 1.06244, 0.486296, 0.508638, 0.54702, 0.805324, 0.692156, 1.0818, 0.657541, 0.835835, 0.467333, 0.824055, 0.44565, 1.09502, 0.916255, 0.477604, 0.554431, 1.07113, 0.975173, 0.728435, 1.00113, 0.475018, 1.0604, 0.50181, 0.502267, 0.821053, 0.5157, 0.474073, 0.784119, 0.722962, 0.515094, 0.827538, 0.762042, 0.480785, 0.608884, 0.585058, 0.435681, 0.925846, 0.440761, 0.527655, 0.765243, 0.440392, 0.709788, 0.388732, 0.760878, 0.488148, 0.847433, 0.411721, 0.687567, 0.386422, 0.70914, 0.492422, 0.754426, 0.477666, 0.678722, 0.545206, 0.697798, 0.576023, 0.769004, 0.615413, 0.721369, 0.783254, 0.637442, 0.755912, 0.691205, 0.767974, 0.574536, 0.721176, 0.740742, 0.622772, 0.735579, 0.493718, 0.685697, 0.497428, 0.706391, 0.467663, 0.679569, 0.481904, 0.650486, 0.490738, 0.675725, 0.539906, 0.673903, 0.494606, 0.62989, 0.486039, 0.668559, 0.535735, 0.732497, 0.588693, 0.615325, 0.611477, 0.660288, 0.515927, 0.69224, 0.559392, 0.640287, 0.521609, 0.657402, 0.532984, 0.702281, 0.483922, 0.648814, 0.329876, 0.729911, 0.631779, 0.467335, 0.567347, 0.593618, 0.586217, 0.491656, 0.548948, 0.605959, 0.575912, 0.664782, 0.621476, 0.699314, 0.7779, 0.610207, 0.432102, 0.614728, 0.592145, 0.451165, 0.529228, 0.668397, 0.37615, 0.739398, 0.801278, 0.594847, 0.657642, 0.441882, 0.545632, 0.542271, 0.655465, 0.460991, 0.642323, 0.485634, 0.884625, 0.453022, 0.753065, 0.415606, 0.940143, 0.458727, 0.58329, 0.53687, 0.635505, 0.497688, 0.716234, 0.737076, 0.88746, 0.561853, 0.653182, 0.654394, 0.508281, 0.653345, 0.440295, 0.545694, 0.468015, 0.618363, 0.589263, 0.512806, 0.534776, 0.450323, 0.577397, 0.499653, 0.423721, 0.58089, 0.522753, 0.573719, 0.476332, 0.706652, 0.463775, 0.596367, 0.532873, 0.644799, 0.508585, 0.536315, 0.660986, 0.657668, 0.634189, 0.612703, 0.722378, 0.686367, 0.495967, 0.62762, 0.486767, 0.668166, 0.464357, 0.630508, 0.469427, 0.634908, 0.454204, 0.65232, 0.434199, 0.694854, 0.665419, 0.447589, 0.683936, 0.516528, 0.66021, 0.561728, 0.84756, 0.788647, 0.410806, 0.759455, 0.454474, 0.927354, 0.436117, 0.78565, 0.533333, 0.75615, 0.722419, 0.43579, 0.773262, 0.734443, 0.760295, 0.796795, 0.864812, 0.393412, 0.840659, 0.434927, 0.759155, 0.576393, 0.778449, 0.801713, 0.876112, 0.871078, 0.740424, 0.775811, 0.793868, 1.00464, 0.955271, 0.921136, 1.15399, 1.06251, 0.914488, 0.861109, 0.892285, 0.881723, 0.872844, 0.858936, 0.741645, 0.68152, 0.620528, 0.820779, 0.76667, 0.673845, 0.513839, 0.596456, 0.730504, 0.723593, 0.836655, 0.843863, 0.75758, 0.653115, 0.605162, 0.62361, 0.579173, 0.591893, 0.621699, 0.707652, 0.89098, 0.720175, 0.666191, 0.632474, 0.57451, 0.613194, 0.67367, 1.27001, 0.88759, 0.912432, 0.552217, 0.487933, 0.615913, 0.495164, 0.587808, 0.513727, 0.60167, 0.605183, 0.573507, 0.59948, 0.581845, 0.598114, 0.666601, 0.546013, 0.595683, 0.598356, 0.580733, 0.609608, 0.612887, 0.601694, 0.56492, 0.540781, 0.499802, 0.740134, 0.533105, 0.482137, 0.527222, 0.560676, 0.541794, 0.600066, 0.524467, 0.597705, 0.532492, 0.547387, 0.525844, 0.513626, 0.591251, 0.59391, 0.739935, 0.607237, 0.638912, 0.568905, 0.602346, 0.530433, 0.662304, 1.00324, 0.847869, 0.601224, 0.610392, 0.650548, 0.56821, 0.532008, 0.503305, 0.598721, 0.581078, 0.664457, 0.562094, 0.528625, 0.556139, 0.546223, 0.575485, 0.551558, 0.499402, 0.544835, 0.549827, 0.678903, 0.556735, 0.541323, 0.563712, 0.576293, 0.624839, 0.811354, 0.804489, 0.645017, 0.593999, 0.701405, 0.626026, 0.495655, 0.604208, 0.552127, 0.63253, 0.531946, 0.551333, 0.643333, 0.647335, 0.712091, 0.573252, 0.660658, 0.563196, 0.602708, 0.553811, 0.634906, 0.612792, 0.679353, 0.731831, 0.603843, 0.602875, 0.619771, 0.852499, 0.524123, 0.756606, 0.726441, 0.614125, 0.577994, 0.709021, 0.568449, 0.608615, 0.901269, 0.64131, 0.902282, 0.803169, 0.86868, 0.650002, 0.652506, 0.741322, 0.605023, 0.574503, 0.685641, 0.640394, 0.665589, 0.658555, 0.701147, 0.649021, 0.70616, 0.535655, 0.740706, 0.727074, 0.657652, 0.726223, 0.687336, 0.616835, 0.718754, 0.594258, 0.703421, 0.66144, 0.769147, 0.696727, 0.617969, 0.583191, 0.638947, 0.586063, 0.483647, 0.528448, 0.530127, 0.402587, 0.713457, 0.681557, 0.492931, 0.568767, 0.554976, 0.639635, 0.526959, 0.592805, 0.622923, 0.531019, 0.544157, 0.531649, 0.528352, 0.85432, 0.461882, 0.638228, 0.523315, 0.602883, 0.587126, 0.589277, 0.626996, 0.545066, 0.555105, 0.521804, 0.574138, 0.575496, 0.690789, 0.849911, 0.613493, 0.860152, 0.801193, 0.548114, 0.895729, 0.870136, 0.630823, 0.553023, 0.517054, 0.51329, 0.50174, 0.555682, 0.534426, 0.509412, 0.588061, 0.501236, 0.489914, 0.505097, 0.945036, 0.473354, 0.414282, 0.686548, 0.555692, 0.375454, 1.08952, 0.750122, 0.714316, 0.866737, 0.801901, 0.80211, 0.917257, 0.790887, 0.79699, 0.708257, 0.679827, 0.770189, 0.710445, 0.839645, 0.914656, 0.683428, 0.541024, 0.797382, 1.14305, 0.563319, 0.707099, 0.605702, 0.547005, 0.505049, 1.16703, 0.526984, 0.498358, 0.515686, 0.855177, 0.495965, 0.66335, 0.733335, 0.772629, 0.585347, 0.641456, 0.510899, 0.812129, 0.804422, 0.536661, 0.704568, 0.649142, 0.686978, 0.425162, 0.619999, 0.618993, 0.602974, 0.528217, 0.551398, 0.657166, 0.649378, 0.683627, 0.630116, 0.595074, 0.545704, 0.807677, 0.482995, 0.531043, 0.554279, 0.494167, 0.503641, 0.624845, 0.608112, 0.750818, 0.475002, 0.560346, 0.929223, 0.505852, 1.52202, 0.640026, 1.6975, 0.441158, 0.526471, 0.518171, 1.1675, 0.48797, 0.74629, 0.490739, 0.707365, 0.488459, 0.733284, 0.461708, 0.865246, 0.431377, 0.780337, 0.585988, 0.843622, 0.465762, 0.534727, 0.507264, 0.521933, 0.560574, 0.528114, 0.503402, 0.555231, 0.820018, 0.626496, 0.614774, 0.526495, 0.449628, 0.820618, 0.545992, 0.375058, 0.618169, 0.481089, 0.718799, 0.559753, 0.527318, 0.652479, 0.5854, 0.629998, 0.461617, 0.642318, 0.55108, 0.674297, 0.539472, 0.818174, 0.47235, 0.581697, 0.750663, 0.828446, 0.560302, 0.566472, 0.503203, 0.49949, 0.644384, 0.56491, 0.664545, 0.667786, 0.619225, 0.517687, 0.61069, 0.621264, 0.80154, 0.951829, 0.53751, 0.743831, 0.576571, 0.561069, 0.711178, 0.743624, 0.550277, 0.599712, 0.607842, 0.609236, 0.51084, 0.671992, 0.542332, 0.477036, 0.65268, 0.403287, 0.47856, 0.563065, 0.719739, 0.540788, 0.499302, 0.491824, 0.446086, 0.413264, 0.580995, 0.525426, 0.640256, 0.593546, 0.662359, 0.557485, 0.668236, 0.547217, 0.615423, 0.807883, 0.639642, 0.61597, 0.614976, 0.718312, 0.695125, 0.475768, 0.580097, 0.575651, 0.600021, 0.714273, 0.580055, 0.692131, 0.604971, 0.689884, 0.501534, 0.693571, 0.629697, 0.605731, 0.661165, 0.791486, 0.530846, 0.637224, 0.702819, 0.666077, 0.65239, 0.721126, 0.547383, 0.757186, 0.670349, 0.728992, 0.576932, 0.790633, 0.699832, 0.783514, 0.546138, 0.692343, 0.78592, 0.520235, 0.742507, 0.627042, 0.592326, 0.546205, 0.684083, 0.513962, 0.499397, 0.635627, 0.683233, 0.662479, 0.724811, 0.657069, 0.712644, 0.651928, 0.687124, 0.517381, 0.580813, 0.602025, 0.754524, 0.737095, 0.659001, 0.679438, 0.594185, 0.751147, 0.94797, 0.764429, 0.752834, 0.978238, 0.944707, 0.583975, 0.904031, 0.99762, 1.0819, 0.917439, 0.681883, 0.623924, 0.801113, 0.86705, 0.985105, 0.665003, 0.895576, 0.698476, 1.2487, 0.776683, 1.1192, 0.676899, 0.920479, 0.633673, 0.979493, 0.8331, 0.776782, 0.648692, 0.735981, 0.532998, 0.949394, 0.525514, 0.884999, 0.660579, 0.570984, 0.824861, 0.612342, 0.794122, 0.713289, 0.758166, 0.581443, 0.465181, 0.657898, 0.547603, 0.571045, 0.561568, 0.582482, 0.620943, 0.721998, 0.57532, 0.73751, 0.605523, 0.701464, 0.610682, 0.675218, 0.624727, 0.642196, 0.603181, 0.793638, 0.69849, 0.7189, 0.769795, 0.666124, 0.728833, 0.647068, 0.587322, 0.592091, 0.597644, 0.799106, 0.688514, 0.612796, 0.629589, 0.634996, 0.794189, 0.552643, 0.925431, 0.626264, 0.571485, 0.683379, 0.666248, 0.690744, 0.615229, 0.798322, 0.688107, 0.562434, 0.637363, 0.711791, 0.751392, 0.715805, 0.638049, 0.6531, 0.653891, 0.701543, 0.665045, 0.67183, 0.649572, 0.688786, 0.868508, 0.768171, 0.650302, 0.76284, 0.745378, 0.702379, 0.686161, 0.698826, 0.679503, 0.757898, 0.69197, 0.663873, 0.727549, 0.604503, 0.638332, 0.560577, 0.716342, 0.807318, 0.440444, 0.642497, 0.657972, 0.553429, 0.609429, 0.878724, 0.681695, 0.671017, 0.763136, 0.65679, 0.84053, 0.60367, 0.82489, 0.614523, 0.896271, 0.744355, 0.798013, 1.07991, 0.837498, 0.879427, 0.785931, 0.783913, 0.715673, 0.770923, 0.919492, 0.83166, 0.812868, 0.686057, 0.783095, 0.730122, 0.817402, 0.642228, 0.758379, 0.560771, 0.765496, 0.638396, 0.872286, 0.564879, 0.808287, 0.794579, 0.769095, 1.03965, 0.759994, 0.898346, 0.871348, 0.764329, 0.90106, 0.976317, 0.695118, 0.98099, 1.08241, 0.983867, 1.00484, 0.815019, 1.0654, 0.829348, 0.877774, 0.940512, 1.00348, 0.8104, 0.822748, 0.829255, 0.879906, 0.954968, 0.998682, 0.990808, 0.988276, 0.745737, 0.77802, 1.11929, 1.69321, 0.710347, 0.884406, 0.814104, 0.854036, 0.988117, 0.980192, 0.771837, 0.70921, 1.12341, 0.769726, 0.671879, 0.872936, 0.671445, 0.734985, 0.767788, 0.740105, 0.732309, 0.581855, 0.670803, 0.970214, 0.606803, 0.542374, 0.856652, 0.630259, 0.915837, 0.671039, 0.620457, 0.600055, 0.661438, 0.689572, 0.717678, 0.565306, 0.670072, 0.67406, 0.773976, 0.705172, 0.594542, 0.558399, 0.669468, 0.762917, 0.625502, 0.801042, 0.658367, 0.639954, 0.675653, 0.697369, 0.75299, 0.694595, 0.820429, 0.628639, 0.884491, 0.667676, 0.633764, 0.700437, 0.508523, 0.534085, 0.850781, 0.825519, 0.702583, 0.540618, 0.822173, 0.856456, 0.811091, 0.619514, 0.631374, 0.636188, 0.838475, 0.875039, 1.17927, 1.00655, 0.891897, 0.911193, 0.532032, 0.524046, 0.724454, 0.602071, 0.471557, 0.8687, 0.674143, 0.456458, 1.08983, 0.84889, 0.843051, 0.811566, 0.896267, 0.764853, 0.860124, 0.397477, 0.79349, 0.81104, 0.906991, 0.476749, 0.762981, 0.590008, 0.709708, 2.67625, 0.76569, 1.7893, 0.871629, 2.92227, 0.618674, 3.58481, 3.5478, 4.00732, 0.702852, 4.6783, 5.13518, 4.86251, 0.682721, 0.694614, 5.53782, 6.62317, 7.23049, 7.26545, 7.13008, 0.778592, 0.813426, 0.836251, 0.819556, 7.30013, 0.781582, 1.0307, 0.855876, 0.762989, 7.54374, 7.50927, 7.6722, 7.42755, 7.51621, 7.80529, 0.742745, 0.83112, 7.76028, 7.73543, 0.796159, 0.680091, 0.706687, 0.76109, 6.15104, 0.775595, 0.742327, 0.906076, 0.885541, 0.846923, 0.85396, 0.826364, 0.816342, 0.727744, 0.708393, 0.845546, 0.950549, 0.78733, 0.812001, 0.909081, 0.818198, 0.841749, 0.830489, 0.80052, 0.709064, 0.792799, 0.80576, 0.840276, 0.879417, 0.813088, 0.834289, 0.848735, 0.861001, 0.90933, 0.803328, 0.917452, 0.726464, 0.666521, 0.682785, 0.703494, 0.741449, 0.638827, 0.633906, 0.677222, 0.720117, 0.482276, 0.560968, 0.812794, 1.04308, 0.814802, 0.828195, 0.700541, 0.666212, 0.619301, 0.766803, 0.848319, 0.901727, 1.01128, 0.870289, 0.831436, 0.772865, 0.617297, 0.589437, 0.668926, 0.813613, 0.865491, 0.786683, 0.830231, 0.663239, 0.680154, 0.714745, 0.705514, 0.914401, 1.141, 0.912102, 1.13965, 1.20878, 1.04324, 1.12545, 1.0372, 0.83634, 1.04155, 1.02922, 1.37331, 1.25244, 1.31574, 1.10484, 0.810841, 0.988373, 0.879487, 1.35506, 1.06888, 1.15954, 1.15613, 1.11743, 0.95671, 1.20474, 1.13876, 0.821849, 1.07239, 1.02679, 1.01291, 1.16458, 1.24931, 1.00438, 1.00005, 1.05839, 1.07671, 1.29262, 1.12721, 1.21244, 1.30393, 1.08953, 1.24683, 1.25567, 1.24264, 1.22418, 1.2431, 1.2822, 1.39419, 1.53873, 1.32601, 1.38475, 1.19541, 1.43708, 1.27904, 1.50957, 1.85637, 1.51256, 1.49384, 1.43579, 1.43942, 1.6226, 1.23855, 1.37954, 1.31324, 1.28747, 1.404, 1.47079, 1.44404, 1.44714, 1.49128, 1.16042, 1.27208, 1.58506, 1.52077, 1.63098, 1.16082, 1.58828, 1.68499, 1.67972, 1.54451, 1.6181, 1.64296, 1.44172, 1.39143, 1.62288, 1.05015, 1.19084, 1.20307, 1.23189, 1.30584, 1.29948, 1.41295, 1.68112, 1.30645, 1.47158, 1.55018, 1.69373, 1.56094, 1.37964, 1.50087, 1.66909, 1.33206, 1.52993, 1.38169, 1.8963, 2.35699, 1.45338, 2.21487, 1.34086, 1.27421, 1.30371, 1.42453, 1.48298, 1.47991, 1.42199, 1.30931, 1.4359, 1.46365, 1.45335, 1.4054, 1.56267, 1.59453, 1.67225, 1.49804 ] +} diff --git a/test/data/runset-big/output_icar_nyc-2_metric.json b/test/data/runset-big/output_icar_nyc-2_metric.json new file mode 100644 index 00000000..f51971a4 --- /dev/null +++ b/test/data/runset-big/output_icar_nyc-2_metric.json @@ -0,0 +1,5 @@ +{ + "stepsize" : 0.0492841, + "metric_type" : "diag_e", + "inv_metric" : [ 0.69403, 0.612598, 0.656885, 0.680565, 0.681994, 0.870403, 0.63675, 0.544767, 0.587672, 0.653818, 0.592125, 0.681454, 0.584285, 0.684506, 0.600483, 0.58525, 0.547498, 0.688109, 0.629366, 0.543963, 0.5319, 0.720568, 0.637357, 0.650216, 0.785584, 0.627137, 0.616493, 0.631452, 0.576128, 0.609948, 0.551325, 0.713006, 0.677433, 0.631044, 0.581662, 0.692727, 0.621057, 0.813299, 0.61611, 0.633249, 0.692428, 0.600667, 0.499129, 0.642422, 0.795887, 0.706499, 0.66255, 0.572747, 0.662953, 0.658112, 0.644924, 0.601801, 0.592749, 0.671728, 0.632896, 0.747848, 0.561209, 0.731133, 0.506378, 0.692959, 0.552555, 0.682027, 0.665196, 0.837025, 0.597517, 0.964929, 0.664388, 0.740806, 0.552777, 0.9021, 0.570657, 0.94855, 0.627843, 0.853535, 0.6508, 0.921796, 0.643484, 0.786877, 0.650892, 0.833266, 0.725796, 0.651848, 0.762002, 0.767043, 0.644688, 0.795329, 0.705084, 0.810984, 0.639812, 0.788756, 0.770688, 0.747062, 0.831895, 0.697347, 0.741338, 0.764502, 0.752109, 1.50323, 0.785279, 0.704002, 0.694736, 0.715678, 0.761219, 0.762653, 1.31231, 0.965318, 0.83214, 1.03839, 0.727583, 0.772419, 0.682437, 0.850501, 0.693507, 0.837947, 0.952939, 0.881008, 0.678938, 1.44167, 0.719849, 1.07881, 0.765089, 1.0094, 0.949318, 1.24315, 0.684559, 1.28419, 0.731957, 1.16597, 0.669893, 1.19042, 0.753722, 1.22256, 0.728692, 0.828443, 0.760865, 0.715849, 1.23496, 0.707039, 0.668845, 1.31133, 0.745593, 0.75185, 1.47373, 0.800379, 0.864723, 1.29883, 0.554873, 1.73044, 0.708838, 1.59311, 0.71782, 0.644191, 1.72062, 0.681094, 0.711603, 1.70291, 0.879817, 0.794482, 1.71996, 0.612869, 1.67973, 0.826388, 1.72259, 0.652932, 1.69319, 0.755818, 1.78703, 0.717142, 1.79691, 0.625162, 1.81943, 0.836083, 0.965032, 1.8082, 1.75398, 0.736258, 1.68613, 0.634593, 1.70636, 0.624103, 1.64712, 0.657589, 1.60028, 0.755447, 1.56483, 0.653115, 1.36496, 0.74089, 1.60773, 0.670391, 1.11833, 0.690716, 1.31967, 0.673911, 0.888578, 1.12399, 0.639303, 1.09385, 0.688155, 1.15825, 0.893764, 1.12873, 1.25104, 0.69438, 1.18193, 0.648797, 0.881916, 0.647874, 1.01874, 0.696109, 0.955879, 0.790754, 0.779365, 0.913233, 0.836541, 1.0129, 0.806934, 0.864384, 0.754773, 1.09363, 1.49324, 0.753066, 1.14008, 0.790349, 1.05113, 0.913531, 1.07674, 0.793696, 0.896363, 0.866924, 1.1111, 0.932663, 0.888574, 0.910572, 0.752179, 1.04877, 0.626859, 0.63548, 1.12643, 1.09846, 0.599739, 1.42479, 0.851545, 1.24759, 1.43897, 1.47928, 1.38274, 1.36589, 1.32371, 0.79614, 0.772979, 1.48794, 1.47875, 1.45546, 1.94988, 1.48483, 1.39312, 1.45487, 1.47768, 1.67481, 1.47467, 1.48891, 1.71861, 1.34278, 1.32946, 1.29583, 1.39896, 1.40877, 1.04336, 1.42197, 1.53868, 1.20199, 0.844916, 1.15983, 0.627573, 0.647665, 0.689084, 0.61204, 0.799033, 0.808272, 0.870826, 0.980554, 1.00279, 0.714974, 0.807629, 0.744635, 0.802756, 0.877767, 0.97071, 0.76206, 0.801623, 0.794065, 0.741166, 0.771483, 0.717033, 0.924401, 0.687902, 0.968623, 0.931323, 0.599039, 0.814585, 1.16753, 0.725674, 0.876264, 0.920191, 0.724871, 0.710531, 0.752834, 0.666434, 0.882695, 0.772644, 0.775437, 0.754182, 0.790504, 0.874906, 0.690977, 0.712483, 0.75174, 0.817923, 0.705937, 0.735078, 0.767888, 0.81118, 0.666927, 0.741904, 0.929753, 0.742695, 0.851688, 0.699364, 0.675425, 0.614023, 0.817198, 0.589007, 0.679381, 0.687862, 0.687198, 0.645519, 0.69483, 0.736677, 0.64973, 0.839683, 0.830909, 0.609351, 0.729774, 0.69307, 0.685627, 0.989509, 0.738093, 0.801908, 0.734125, 0.725182, 0.836132, 0.729889, 0.791247, 1.01175, 0.817659, 0.89884, 0.941585, 0.734821, 0.720164, 0.787323, 0.840395, 0.833388, 0.763115, 1.08941, 0.719479, 0.911273, 0.87211, 0.918652, 0.828145, 0.861391, 0.830462, 0.981866, 0.937631, 0.759691, 0.858743, 0.808926, 0.751738, 0.785764, 0.845254, 0.941956, 0.829973, 0.874191, 0.928096, 0.870135, 0.663039, 0.966047, 0.836221, 0.697939, 0.840212, 0.775356, 0.77209, 0.779802, 0.869863, 0.892449, 0.807341, 0.86406, 1.00736, 0.836291, 0.764392, 0.803602, 0.927563, 0.826354, 0.988629, 0.862949, 0.907305, 0.99984, 0.911681, 0.901109, 0.73706, 0.81566, 0.811825, 0.748848, 0.870525, 0.942958, 0.870433, 0.786006, 0.914668, 1.17758, 0.966096, 1.11317, 0.791858, 0.916605, 0.869577, 0.851532, 1.04181, 0.837052, 0.970744, 0.912369, 0.983032, 0.949692, 0.919602, 0.960858, 1.09496, 1.03947, 0.902311, 1.12861, 1.02246, 0.956884, 0.808353, 0.977152, 0.76739, 0.946482, 0.91145, 0.953215, 0.965899, 1.20045, 0.899449, 1.00032, 0.923597, 0.889973, 1.02694, 0.948856, 1.14105, 1.00621, 1.11088, 0.842096, 1.13572, 1.29304, 1.15391, 0.836235, 1.11402, 1.09367, 1.11946, 1.20321, 1.58255, 1.07909, 1.15383, 0.935375, 1.40649, 1.37383, 1.32813, 1.43955, 1.18213, 0.740801, 1.4499, 0.857666, 1.53461, 0.941553, 1.3626, 1.86897, 1.44063, 1.51425, 0.817649, 1.52769, 1.13112, 1.64195, 2.36593, 1.59889, 1.7973, 0.973048, 1.11677, 1.13033, 1.09678, 1.08173, 1.76412, 0.968797, 0.986312, 1.03573, 1.14385, 1.33728, 1.23906, 1.56556, 1.31987, 1.74272, 1.09294, 1.08125, 1.02168, 2.22325, 1.08172, 2.0318, 1.02335, 1.02568, 1.75617, 1.12377, 1.05504, 0.86035, 0.986926, 0.988317, 0.99218, 1.05238, 1.08066, 0.912993, 1.0445, 1.0813, 0.970574, 0.946057, 1.1467, 1.11553, 1.10442, 1.00179, 1.24479, 1.14866, 1.49374, 1.29956, 0.941744, 1.23496, 0.995822, 1.14654, 0.975122, 1.09503, 1.11245, 1.08753, 1.16686, 1.275, 1.23802, 1.17525, 1.16886, 1.42577, 1.01379, 1.46104, 0.91939, 1.25924, 1.03534, 1.23371, 1.08637, 1.09758, 1.08332, 1.19693, 1.25611, 1.1837, 1.34248, 1.29723, 1.2408, 1.26268, 1.20686, 1.19433, 1.49053, 1.12517, 1.28918, 1.38305, 1.67113, 1.48297, 1.68872, 1.42759, 1.44337, 1.39258, 1.36995, 1.56586, 1.34991, 1.6534, 1.28947, 1.45879, 1.72412, 1.87526, 1.42519, 1.73769, 1.41201, 1.56199, 1.68975, 1.52824, 1.54212, 3.1677, 2.353, 2.05313, 1.90542, 1.31143, 1.24197, 1.20524, 1.28047, 1.1404, 1.25487, 2.04504, 0.515887, 1.0975, 0.598367, 0.650574, 0.581889, 0.531479, 0.63173, 0.584907, 0.517935, 1.00462, 0.50671, 0.910881, 0.658983, 0.702591, 1.04697, 0.5737, 0.580962, 1.09809, 0.537363, 1.07415, 0.55251, 1.03002, 0.597248, 0.578318, 0.618272, 1.06289, 0.636492, 1.04231, 0.810872, 0.682751, 1.12188, 0.961118, 1.16053, 1.26838, 0.880398, 1.15622, 1.12008, 1.29228, 1.13514, 0.963286, 1.11807, 1.18486, 0.853549, 0.956, 0.817364, 0.933705, 0.67863, 0.969131, 0.652001, 0.941242, 0.610376, 0.938772, 0.848689, 0.671263, 0.878139, 0.832161, 0.975759, 0.949167, 1.00926, 1.06143, 1.40624, 1.01413, 1.05595, 0.865897, 0.85549, 0.915563, 0.87817, 0.80524, 1.22933, 0.786403, 0.819447, 0.796538, 0.856471, 0.786929, 0.807593, 0.759976, 0.749603, 0.736058, 0.804657, 0.558373, 0.807357, 0.767119, 0.853071, 0.833518, 0.580011, 0.895697, 0.613327, 0.65538, 1.05682, 0.56343, 0.885356, 0.626876, 0.932981, 0.707483, 0.972166, 0.659461, 1.05134, 0.68498, 1.16613, 0.815303, 1.02965, 0.798386, 0.995002, 0.793042, 1.07769, 0.632387, 1.01003, 0.675464, 1.29583, 0.685762, 0.701297, 0.691127, 0.555625, 1.03285, 0.558849, 1.15318, 0.579494, 1.04497, 0.721693, 1.01868, 0.795274, 1.07553, 0.856489, 1.10589, 0.946866, 0.97192, 1.02533, 1.12436, 0.929111, 0.535347, 1.13348, 0.564724, 0.870472, 0.578172, 1.0069, 0.657287, 0.994977, 0.620307, 0.875037, 0.838269, 0.548351, 0.776723, 0.5035, 0.846691, 0.601434, 0.876834, 0.475011, 0.895977, 0.571383, 0.988054, 0.523895, 1.07073, 0.593751, 1.12529, 0.733401, 0.991018, 0.915754, 0.903702, 0.845012, 0.553492, 0.776514, 0.656594, 0.770091, 0.650765, 0.795494, 0.550115, 0.788929, 0.467282, 0.777781, 0.484765, 0.827952, 0.777174, 0.735251, 0.478988, 0.798366, 0.502466, 0.842934, 0.521609, 0.788463, 0.510516, 0.85323, 0.624875, 0.750307, 0.77764, 0.763908, 0.46468, 0.775728, 0.49528, 0.77641, 0.512541, 0.689974, 0.420439, 0.81258, 0.465102, 0.752147, 0.451024, 0.812326, 0.466575, 0.748672, 0.490709, 0.74294, 0.549162, 0.924375, 0.531484, 0.658405, 0.84001, 0.506376, 0.847462, 0.529044, 0.786962, 0.511222, 0.848781, 0.586449, 0.915431, 0.52064, 0.842124, 0.417814, 0.765081, 0.547837, 0.895021, 0.505243, 0.866044, 0.529716, 0.918492, 0.502316, 0.970552, 0.502024, 1.02984, 0.552233, 0.862887, 0.717936, 0.530579, 0.957075, 0.493452, 0.933902, 0.482688, 0.999938, 0.569582, 1.06746, 0.497598, 1.03638, 0.515311, 0.91552, 0.450283, 0.922108, 0.427391, 0.893374, 0.42949, 0.968795, 0.499094, 1.04489, 0.460179, 0.866679, 0.43049, 0.909273, 0.537505, 0.531057, 0.501974, 0.966578, 0.615281, 0.520888, 0.493033, 0.50858, 0.482937, 0.524512, 0.600818, 1.07361, 0.498745, 1.19045, 0.474275, 1.07857, 0.474557, 0.562217, 0.678519, 1.07841, 0.645917, 0.534619, 1.15071, 0.533666, 1.14351, 0.518254, 0.551244, 0.507084, 0.917985, 0.628774, 1.11505, 0.666791, 0.952202, 0.482188, 0.902757, 0.448396, 1.16919, 1.00303, 0.46021, 0.503629, 1.13855, 1.15475, 0.61931, 1.03723, 0.409893, 1.14991, 0.436846, 0.38982, 0.936722, 0.395613, 0.384326, 0.889599, 0.631052, 0.439364, 0.87572, 0.877774, 0.524946, 0.579144, 0.510497, 0.467009, 1.02848, 0.516712, 0.56538, 0.831735, 0.52621, 0.771414, 0.460102, 0.806613, 0.535646, 0.911767, 0.444857, 0.745831, 0.433531, 0.829673, 0.534902, 0.832442, 0.501971, 0.77454, 0.515578, 0.788662, 0.520139, 0.884866, 0.519033, 0.827113, 0.834812, 0.630431, 0.846116, 0.639639, 0.917745, 0.566889, 0.805623, 0.834185, 0.62028, 0.802537, 0.537306, 0.722067, 0.550373, 0.800705, 0.51016, 0.766568, 0.564589, 0.779877, 0.612988, 0.78164, 0.596256, 0.778128, 0.533091, 0.74743, 0.517961, 0.751599, 0.552413, 0.769051, 0.603851, 0.680608, 0.590308, 0.742916, 0.529024, 0.717895, 0.588336, 0.667926, 0.560887, 0.722009, 0.576807, 0.730086, 0.565012, 0.706329, 0.380966, 0.809425, 0.663623, 0.528339, 0.60522, 0.64774, 0.615599, 0.564311, 0.676071, 0.701552, 0.661287, 0.723363, 0.71589, 0.802129, 0.828008, 0.737893, 0.51003, 0.736642, 0.726977, 0.55618, 0.683278, 0.729403, 0.448385, 0.848521, 0.818472, 0.610236, 0.772946, 0.521861, 0.631147, 0.608294, 0.734061, 0.552317, 0.680234, 0.575946, 0.8992, 0.523585, 0.78548, 0.498492, 0.931385, 0.529072, 0.616007, 0.616407, 0.649214, 0.601127, 0.730085, 0.733752, 0.898317, 0.610877, 0.760432, 0.694497, 0.597975, 0.724037, 0.536342, 0.635483, 0.528672, 0.69555, 0.718172, 0.572223, 0.590285, 0.509529, 0.667403, 0.567671, 0.553062, 0.65186, 0.647686, 0.652881, 0.610263, 0.720909, 0.532727, 0.64042, 0.647854, 0.741532, 0.630749, 0.624025, 0.706806, 0.794915, 0.653081, 0.655703, 0.904768, 0.660546, 0.667115, 0.655342, 0.585829, 0.727137, 0.524846, 0.648749, 0.514676, 0.6658, 0.548274, 0.662766, 0.495417, 0.703662, 0.692966, 0.4887, 0.779978, 0.558486, 0.693398, 0.542923, 0.90293, 0.897656, 0.506044, 0.828411, 0.519287, 0.980685, 0.499538, 0.791191, 0.547086, 0.771372, 0.725465, 0.487935, 0.745249, 0.762547, 0.778665, 0.77992, 0.885528, 0.470413, 0.86269, 0.502985, 0.782787, 0.682734, 0.78665, 0.859789, 0.865596, 0.893268, 0.798457, 0.875106, 0.901636, 1.1166, 1.08915, 1.06297, 1.22184, 1.19638, 1.01899, 0.901043, 0.935661, 0.905112, 0.951291, 0.840305, 0.822551, 0.705589, 0.644702, 0.765545, 0.68296, 0.666356, 0.588396, 0.611417, 0.694702, 0.722556, 0.879381, 0.778156, 0.754306, 0.680316, 0.622935, 0.661082, 0.602587, 0.618633, 0.658676, 0.724148, 0.95169, 0.705769, 0.620996, 0.6519, 0.607148, 0.619769, 0.672804, 1.26457, 0.931426, 0.842243, 0.559059, 0.515165, 0.609115, 0.521369, 0.597526, 0.590189, 0.632221, 0.617406, 0.605857, 0.618071, 0.604188, 0.630031, 0.633511, 0.591923, 0.62583, 0.64523, 0.7157, 0.684901, 0.724276, 0.628753, 0.624811, 0.590681, 0.59518, 0.818598, 0.612919, 0.580039, 0.6227, 0.65363, 0.60707, 0.660626, 0.568417, 0.681413, 0.662089, 0.593848, 0.616933, 0.596296, 0.624831, 0.634077, 0.783991, 0.614523, 0.63152, 0.613709, 0.588524, 0.491011, 0.54486, 0.929563, 0.831444, 0.633419, 0.609273, 0.690161, 0.589246, 0.561082, 0.567798, 0.697703, 0.638429, 0.742115, 0.613234, 0.5921, 0.588104, 0.616676, 0.570901, 0.520859, 0.510226, 0.562209, 0.590925, 0.626402, 0.560487, 0.510443, 0.508807, 0.503075, 0.591272, 0.865929, 0.768035, 0.62732, 0.578953, 0.616972, 0.570839, 0.478817, 0.60401, 0.517079, 0.533824, 0.461307, 0.529556, 0.560049, 0.543325, 0.568041, 0.504861, 0.537242, 0.478621, 0.485493, 0.50122, 0.523987, 0.467555, 0.533738, 0.603223, 0.50322, 0.448288, 0.553714, 0.787789, 0.553295, 0.682332, 0.607913, 0.528937, 0.579964, 0.67059, 0.514412, 0.626682, 0.846077, 0.686419, 0.858067, 0.724717, 0.735889, 0.582016, 0.546983, 0.632253, 0.528789, 0.534045, 0.666619, 0.60729, 0.570758, 0.671725, 0.635811, 0.616389, 0.69779, 0.505004, 0.679501, 0.660393, 0.604523, 0.659778, 0.600977, 0.574556, 0.688094, 0.570542, 0.666353, 0.591985, 0.640483, 0.619785, 0.562286, 0.540066, 0.574279, 0.522742, 0.44137, 0.437248, 0.455375, 0.356078, 0.658631, 0.570883, 0.419236, 0.470739, 0.472783, 0.553306, 0.487966, 0.565383, 0.534385, 0.481871, 0.438136, 0.455763, 0.493985, 0.706013, 0.408381, 0.526036, 0.474815, 0.5258, 0.499602, 0.49827, 0.539764, 0.494352, 0.492262, 0.424357, 0.491255, 0.481231, 0.526414, 0.727592, 0.56569, 0.769965, 0.725471, 0.510989, 0.862318, 0.714061, 0.562719, 0.505062, 0.491483, 0.422284, 0.434122, 0.483642, 0.446921, 0.436432, 0.590499, 0.48909, 0.455641, 0.461313, 0.875743, 0.445138, 0.471725, 0.651593, 0.647097, 0.501455, 0.891037, 0.643968, 0.567607, 1.10864, 0.665904, 0.625009, 0.753763, 0.657058, 0.647008, 0.641507, 0.875276, 0.72538, 0.59766, 0.757442, 1.06397, 0.69787, 0.527591, 0.696701, 1.37557, 0.491772, 0.862425, 0.522059, 0.475205, 0.456005, 1.26152, 0.493817, 0.496096, 0.480828, 0.962207, 0.496973, 0.815871, 0.911303, 0.957256, 0.533793, 0.760677, 0.468819, 0.976752, 0.866815, 0.55004, 0.863693, 0.763308, 0.711242, 0.429378, 0.779486, 0.745203, 0.708054, 0.657823, 0.687714, 0.756649, 0.765897, 0.820663, 0.750733, 0.763932, 0.70501, 0.974527, 0.496609, 0.699, 0.553413, 0.607201, 0.494774, 0.798222, 0.577643, 0.991029, 0.466739, 0.60663, 1.06489, 0.539662, 1.70116, 0.641614, 1.7884, 0.48086, 0.559743, 0.572367, 1.28638, 0.465044, 0.929162, 0.504898, 0.866708, 0.52138, 0.841191, 0.551707, 0.982873, 0.493139, 0.903764, 0.718046, 0.95626, 0.521893, 0.664869, 0.602903, 0.595013, 0.643445, 0.616649, 0.585397, 0.53374, 0.955685, 0.71973, 0.710613, 0.574868, 0.511863, 0.786231, 0.550984, 0.456543, 0.705663, 0.562387, 0.814773, 0.657692, 0.609873, 0.773641, 0.648769, 0.770126, 0.500483, 0.794707, 0.626849, 0.743786, 0.576406, 0.980033, 0.482847, 0.557773, 0.958198, 1.00389, 0.66456, 0.601835, 0.559262, 0.514155, 0.85437, 0.57672, 0.673664, 0.719426, 0.621452, 0.539538, 0.720353, 0.651885, 0.905616, 1.05071, 0.604287, 0.872452, 0.663833, 0.620308, 0.870952, 0.899255, 0.622362, 0.754075, 0.648823, 0.725013, 0.565477, 0.709603, 0.550614, 0.503132, 0.660243, 0.498889, 0.492213, 0.584329, 0.942955, 0.59885, 0.598035, 0.604471, 0.518668, 0.461044, 0.584193, 0.54755, 0.680065, 0.645775, 0.827115, 0.650122, 0.723167, 0.651788, 0.716531, 0.932258, 0.738451, 0.760486, 0.798754, 0.900485, 0.878819, 0.550314, 0.735243, 0.710726, 0.622694, 0.904185, 0.613423, 0.791625, 0.629671, 0.83599, 0.516681, 0.849481, 0.697667, 0.692924, 0.770439, 0.835781, 0.542655, 0.763342, 0.671544, 0.755558, 0.659894, 0.786982, 0.641349, 0.894874, 0.76916, 0.821988, 0.649219, 0.866032, 0.779774, 0.838927, 0.640409, 0.790136, 0.841424, 0.609289, 0.755029, 0.761685, 0.718755, 0.612979, 0.890153, 0.625862, 0.601315, 0.717798, 0.751357, 0.68705, 0.761328, 0.786612, 0.779124, 0.769829, 0.723879, 0.637, 0.667249, 0.726107, 0.850904, 0.882047, 0.678529, 0.740383, 0.679952, 0.769027, 0.948023, 0.834268, 0.789293, 0.997014, 1.01645, 0.689899, 0.966721, 1.01394, 1.1831, 1.03024, 0.763296, 0.718113, 0.835361, 0.909673, 1.0452, 0.811552, 0.933416, 0.791558, 1.21892, 0.889814, 1.14266, 0.774795, 0.955974, 0.743279, 1.01368, 0.89141, 0.870351, 0.713713, 0.782475, 0.56601, 0.990214, 0.569557, 0.958813, 0.736684, 0.633295, 0.83777, 0.651919, 0.828896, 0.755482, 0.798757, 0.691438, 0.526939, 0.74748, 0.63139, 0.669482, 0.636114, 0.644042, 0.681023, 0.82293, 0.601426, 0.83347, 0.63461, 0.772277, 0.611147, 0.827983, 0.665417, 0.806621, 0.629681, 0.922896, 0.675991, 0.842293, 0.739244, 0.766825, 0.757188, 0.750827, 0.599533, 0.713535, 0.6526, 0.839746, 0.696003, 0.685508, 0.699141, 0.726058, 0.840875, 0.690889, 1.01923, 0.717387, 0.689645, 0.733439, 0.800883, 0.760731, 0.682933, 0.917122, 0.754266, 0.627587, 0.694561, 0.795591, 0.819711, 0.835744, 0.655812, 0.74691, 0.693157, 0.824224, 0.779037, 0.783047, 0.8512, 0.823538, 0.979332, 0.970953, 0.713933, 0.877156, 0.861629, 0.777579, 0.830384, 0.794234, 0.661988, 0.827535, 0.803556, 0.778159, 0.691359, 0.791486, 0.812545, 0.548937, 0.940749, 1.01905, 0.475336, 0.814684, 0.753059, 0.5673, 0.6622, 0.941494, 0.691012, 0.628198, 0.79464, 0.644589, 0.898203, 0.640442, 0.881613, 0.613822, 0.990088, 0.725522, 0.915428, 1.1428, 0.926687, 0.861363, 0.88932, 0.806304, 0.8282, 0.740855, 0.831789, 0.962641, 0.733809, 0.873752, 0.77994, 0.737723, 0.809327, 0.638993, 0.926079, 0.562487, 0.915913, 0.643659, 1.03311, 0.570555, 0.945303, 0.97194, 0.765705, 1.18278, 0.790483, 0.922481, 0.944935, 0.919527, 1.04264, 0.977233, 0.639781, 0.914633, 0.93955, 0.850653, 0.896463, 0.892755, 0.969732, 0.856264, 0.952555, 0.8921, 1.02093, 0.841244, 0.766556, 0.802606, 0.900604, 0.887413, 0.986856, 1.05247, 1.05824, 0.780571, 0.785809, 1.12589, 1.54301, 0.755343, 0.908298, 0.868561, 0.969723, 1.1362, 1.13439, 0.915963, 0.843751, 1.2443, 0.891258, 0.77107, 1.06103, 0.769122, 0.851583, 0.836349, 0.75854, 0.862209, 0.614656, 0.796238, 1.01207, 0.710047, 0.62216, 1.04243, 0.722052, 1.0977, 0.662658, 0.670356, 0.64317, 0.693631, 0.760308, 0.713902, 0.553851, 0.678461, 0.720785, 0.803522, 0.715269, 0.633782, 0.643857, 0.676084, 0.724557, 0.624065, 0.843243, 0.697065, 0.67335, 0.693882, 0.679927, 0.728024, 0.675543, 0.782809, 0.702245, 0.800564, 0.666664, 0.623877, 0.652152, 0.539111, 0.54415, 0.812673, 0.882211, 0.698425, 0.57314, 0.843425, 0.887772, 0.781449, 0.715018, 0.740893, 0.698889, 0.860123, 0.905791, 1.14899, 0.989336, 0.891339, 0.889136, 0.60141, 0.551837, 0.786038, 0.625232, 0.539982, 0.942232, 0.778461, 0.501947, 1.08203, 0.83623, 0.84954, 0.885637, 0.949305, 0.855016, 0.922589, 0.417159, 0.835851, 0.817786, 0.878864, 0.48471, 0.820615, 0.553533, 0.718671, 3.02325, 0.823575, 2.00256, 0.92195, 2.75898, 0.606771, 3.4079, 3.35432, 3.79227, 0.671976, 4.35295, 4.66399, 4.38852, 0.652066, 0.691738, 4.90837, 5.82195, 6.39783, 6.43885, 6.39784, 0.761605, 0.698679, 0.772085, 0.799538, 6.44354, 0.759783, 1.01612, 0.813471, 0.697936, 6.58855, 6.7234, 6.87381, 6.54632, 6.74893, 7.2594, 0.705714, 0.796065, 7.07557, 7.03635, 0.743334, 0.67886, 0.682803, 0.723543, 5.82877, 0.683098, 0.698941, 0.887309, 0.820623, 0.787079, 0.868721, 0.825887, 0.812477, 0.672134, 0.707614, 0.785798, 0.891567, 0.78589, 0.796976, 0.876221, 0.824514, 0.855669, 0.817252, 0.80873, 0.68981, 0.749926, 0.86741, 0.891556, 0.919315, 0.837911, 0.915338, 0.914601, 0.919426, 0.995724, 0.880879, 0.957501, 0.792889, 0.685703, 0.690506, 0.749956, 0.713334, 0.654342, 0.6742, 0.651055, 0.680919, 0.520001, 0.644215, 0.835421, 0.958988, 0.774766, 0.855681, 0.804326, 0.702941, 0.647304, 0.856876, 0.791826, 0.85773, 0.92348, 0.792805, 0.738386, 0.778416, 0.690413, 0.661241, 0.70253, 0.759932, 0.88317, 0.732588, 0.819095, 0.666747, 0.725811, 0.692901, 0.728732, 0.831259, 1.22213, 0.837773, 1.3008, 1.3132, 1.17101, 1.31875, 1.15892, 0.900731, 1.07945, 1.0688, 1.49192, 1.35469, 1.3193, 1.12919, 0.857017, 1.097, 1.07786, 1.41308, 1.22362, 1.27962, 1.20091, 1.20998, 1.15106, 1.30615, 1.2674, 0.973318, 1.17772, 1.17026, 1.17601, 1.29423, 1.37492, 1.13871, 1.13761, 1.19421, 1.20976, 1.31223, 1.2044, 1.30145, 1.35161, 1.21297, 1.30958, 1.28934, 1.33267, 1.30771, 1.3484, 1.3573, 1.49991, 1.58382, 1.40982, 1.47303, 1.33969, 1.54171, 1.34523, 1.61027, 2.05502, 1.74312, 1.6355, 1.61891, 1.64841, 1.7802, 1.3624, 1.5233, 1.49958, 1.30293, 1.54425, 1.65743, 1.6273, 1.65014, 1.7158, 1.26725, 1.30978, 1.78232, 1.65978, 1.79484, 1.25924, 1.64825, 1.64792, 1.62415, 1.63837, 1.70791, 1.73425, 1.49826, 1.48481, 1.80283, 1.18717, 1.31724, 1.35255, 1.37098, 1.39767, 1.46655, 1.56367, 1.85568, 1.31945, 1.4489, 1.63991, 1.8529, 1.69767, 1.38494, 1.49812, 1.80605, 1.45014, 1.54345, 1.39818, 2.10223, 2.40533, 1.41157, 2.39153, 1.3493, 1.34802, 1.42389, 1.5861, 1.57709, 1.61825, 1.56883, 1.40551, 1.43588, 1.52607, 1.46209, 1.34717, 1.52714, 1.5347, 1.60514, 1.47131 ] +} diff --git a/test/test_cmdstan_args.py b/test/test_cmdstan_args.py index f25c9be4..df656fa6 100644 --- a/test/test_cmdstan_args.py +++ b/test/test_cmdstan_args.py @@ -241,7 +241,7 @@ def test_metric() -> None: args = SamplerArgs() args.validate(chains=4) cmd = args.compose(1, cmd=[]) - assert 'metric=' not in ' '.join(cmd) + assert ' metric=' not in ' '.join(cmd) jmetric = os.path.join(DATAFILES_PATH, 'bernoulli.metric.json') args = SamplerArgs(metric_file=jmetric) diff --git a/test/test_metadata.py b/test/test_metadata.py index 9e875a15..6a0f3d6f 100644 --- a/test/test_metadata.py +++ b/test/test_metadata.py @@ -1,9 +1,18 @@ """Metadata tests""" +import json +import math import os +import tempfile +from pathlib import Path + +import numpy as np +import pytest +from pydantic import ValidationError from cmdstanpy.cmdstan_args import CmdStanArgs, SamplerArgs from cmdstanpy.stanfit import InferenceMetadata, RunSet +from cmdstanpy.stanfit.metadata import MetricInfo from cmdstanpy.utils import EXTENSION, check_sampler_csv HERE = os.path.dirname(os.path.abspath(__file__)) @@ -67,3 +76,259 @@ def test_good() -> None: assert hmc_vars == method_vars_cols.keys() bern_model_vars = {'theta'} assert bern_model_vars == metadata.stan_vars.keys() + + +class TestMetricInfoValidators: + """Test custom validators for MetricInfo model""" + + def test_valid_diag_e_metric(self) -> None: + """Test valid diag_e metric with 1D array""" + metric = MetricInfo( + chain_id=1, + stepsize=0.5, + metric_type="diag_e", + inv_metric=[1.0, 2.0, 3.0], # type: ignore + ) + assert metric.chain_id == 1 + assert metric.stepsize == 0.5 + assert isinstance(metric.inv_metric, np.ndarray) + assert metric.inv_metric.ndim == 1 + + def test_valid_unit_e_metric(self) -> None: + """Test valid unit_e metric with 1D array""" + metric = MetricInfo( + chain_id=2, + stepsize=0.1, + metric_type="unit_e", + inv_metric=[1.0, 1.0, 1.0], # type: ignore + ) + assert metric.metric_type == "unit_e" + assert metric.inv_metric.ndim == 1 + + def test_valid_dense_e_metric(self) -> None: + """Test valid dense_e metric with 2D square array""" + metric = MetricInfo( + chain_id=1, + stepsize=0.3, + metric_type="dense_e", + inv_metric=[[1.0, 0.5], [0.5, 1.0]], # type: ignore + ) + assert metric.metric_type == "dense_e" + assert metric.inv_metric.ndim == 2 + assert metric.inv_metric.shape == (2, 2) + + def test_convert_inv_metric_from_list(self) -> None: + """Test that inv_metric is converted to numpy array from list""" + metric = MetricInfo( + chain_id=1, + stepsize=0.5, + metric_type="diag_e", + inv_metric=[1.0, 2.0, 3.0], # type: ignore + ) + assert isinstance(metric.inv_metric, np.ndarray) + + def test_convert_inv_metric_from_nested_list(self) -> None: + """Test that inv_metric is converted to numpy array from nested list""" + metric = MetricInfo( + chain_id=1, + stepsize=0.5, + metric_type="dense_e", + inv_metric=[[1.0, 0.0], [0.0, 1.0]], # type: ignore + ) + assert isinstance(metric.inv_metric, np.ndarray) + + def test_stepsize_positive(self) -> None: + """Test valid positive stepsize""" + metric = MetricInfo( + chain_id=1, + stepsize=0.5, + metric_type="diag_e", + inv_metric=[1.0], # type: ignore + ) + assert metric.stepsize == 0.5 + + def test_stepsize_nan_allowed(self) -> None: + """Test that NaN stepsize is allowed""" + metric = MetricInfo( + chain_id=1, + stepsize=math.nan, + metric_type="diag_e", + inv_metric=[1.0], # type: ignore + ) + assert math.isnan(metric.stepsize) + + def test_stepsize_zero_raises_error(self) -> None: + """Test that zero stepsize raises ValueError""" + with pytest.raises(ValidationError) as exc_info: + MetricInfo( + chain_id=1, + stepsize=0.0, + metric_type="diag_e", + inv_metric=[1.0], # type: ignore + ) + assert "stepsize must be greater than 0 or NaN" in str(exc_info.value) + + def test_stepsize_negative_raises_error(self) -> None: + """Test that negative stepsize raises ValueError""" + with pytest.raises(ValidationError) as exc_info: + MetricInfo( + chain_id=1, + stepsize=-0.5, + metric_type="diag_e", + inv_metric=[1.0], # type: ignore + ) + assert "stepsize must be greater than 0 or NaN" in str(exc_info.value) + + def test_diag_e_with_2d_array_raises_error(self) -> None: + """Test that diag_e with 2D array raises ValueError""" + with pytest.raises(ValidationError) as exc_info: + MetricInfo( + chain_id=1, + stepsize=0.5, + metric_type="diag_e", + inv_metric=[[1.0, 2.0]], # type: ignore + ) + assert "inv_metric must be 1D for diag_e and unit_e" in str( + exc_info.value + ) + + def test_unit_e_with_2d_array_raises_error(self) -> None: + """Test that unit_e with 2D array raises ValueError""" + with pytest.raises(ValidationError) as exc_info: + MetricInfo( + chain_id=1, + stepsize=0.5, + metric_type="unit_e", + inv_metric=[[1.0], [1.0]], # type: ignore + ) + assert "inv_metric must be 1D for diag_e and unit_e" in str( + exc_info.value + ) + + def test_dense_e_with_1d_array_raises_error(self) -> None: + """Test that dense_e with 1D array raises ValueError""" + with pytest.raises(ValidationError) as exc_info: + MetricInfo( + chain_id=1, + stepsize=0.5, + metric_type="dense_e", + inv_metric=[1.0, 2.0], # type: ignore + ) + assert "Dense inv_metric must be 2D" in str(exc_info.value) + + def test_dense_e_non_square_raises_error(self) -> None: + """Test that dense_e with non-square array raises ValueError""" + with pytest.raises(ValidationError) as exc_info: + MetricInfo( + chain_id=1, + stepsize=0.5, + metric_type="dense_e", + inv_metric=[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], # type: ignore + ) + assert "Dense inv_metric must be square" in str(exc_info.value) + + def test_chain_id_must_be_positive(self) -> None: + """Test that chain_id must be greater than 0""" + with pytest.raises(ValidationError) as exc_info: + MetricInfo( + chain_id=0, + stepsize=0.5, + metric_type="diag_e", + inv_metric=[1.0], # type: ignore + ) + assert "greater than 0" in str(exc_info.value) + + +class TestMetricInfoFromJson: + """Test from_json class method""" + + def test_from_json_diag_e(self) -> None: + """Test loading diag_e metric from JSON file""" + with tempfile.NamedTemporaryFile( + mode='w', suffix='.json', delete=False + ) as f: + json.dump( + { + 'stepsize': 0.5, + 'metric_type': 'diag_e', + 'inv_metric': [1.0, 2.0, 3.0], + }, + f, + ) + temp_path = f.name + + try: + metric = MetricInfo.from_json(temp_path, chain_id=1) + assert metric.chain_id == 1 + assert metric.stepsize == 0.5 + assert metric.metric_type == "diag_e" + assert np.array_equal(metric.inv_metric, np.array([1.0, 2.0, 3.0])) + finally: + Path(temp_path).unlink() + + def test_from_json_dense_e(self) -> None: + """Test loading dense_e metric from JSON file""" + with tempfile.NamedTemporaryFile( + mode='w', suffix='.json', delete=False + ) as f: + json.dump( + { + 'stepsize': 0.3, + 'metric_type': 'dense_e', + 'inv_metric': [[1.0, 0.5], [0.5, 1.0]], + }, + f, + ) + temp_path = f.name + + try: + metric = MetricInfo.from_json(temp_path, chain_id=2) + assert metric.chain_id == 2 + assert metric.stepsize == 0.3 + assert metric.metric_type == "dense_e" + assert metric.inv_metric.shape == (2, 2) + finally: + Path(temp_path).unlink() + + def test_from_json_invalid_data_raises_error(self) -> None: + """Test that invalid data in JSON raises ValidationError""" + with tempfile.NamedTemporaryFile( + mode='w', suffix='.json', delete=False + ) as f: + json.dump( + { + 'stepsize': -0.5, # Invalid: negative stepsize + 'metric_type': 'diag_e', + 'inv_metric': [1.0, 2.0, 3.0], + }, + f, + ) + temp_path = f.name + + try: + with pytest.raises(ValidationError): + MetricInfo.from_json(temp_path, chain_id=1) + finally: + Path(temp_path).unlink() + + def test_from_json_pathlike(self) -> None: + """Test from_json works with PathLike objects""" + with tempfile.NamedTemporaryFile( + mode='w', suffix='.json', delete=False + ) as f: + json.dump( + { + 'stepsize': 0.5, + 'metric_type': 'unit_e', + 'inv_metric': [1.0, 1.0], + }, + f, + ) + temp_path = Path(f.name) + + try: + metric = MetricInfo.from_json(temp_path, chain_id=3) + assert metric.chain_id == 3 + assert metric.metric_type == "unit_e" + finally: + temp_path.unlink() diff --git a/test/test_runset.py b/test/test_runset.py index 616b3519..c7cc69c4 100644 --- a/test/test_runset.py +++ b/test/test_runset.py @@ -3,7 +3,7 @@ import os from cmdstanpy import _TMPDIR -from cmdstanpy.cmdstan_args import CmdStanArgs, SamplerArgs +from cmdstanpy.cmdstan_args import CmdStanArgs, PathfinderArgs, SamplerArgs from cmdstanpy.stanfit import RunSet from cmdstanpy.utils import EXTENSION @@ -299,3 +299,59 @@ def test_chain_ids() -> None: assert '_11.csv' in runset._csv_files[0] assert 'id=14' in runset.cmd(3) assert '_14.csv' in runset._csv_files[3] + + +def test_metric_output_filename() -> None: + exe = os.path.join(DATAFILES_PATH, 'bernoulli' + EXTENSION) + jdata = os.path.join(DATAFILES_PATH, 'bernoulli.data.json') + + # Single chain + sampler_args = SamplerArgs() + chain_ids = [1] + cmdstan_args = CmdStanArgs( + model_name='bernoulli', + model_exe=exe, + chain_ids=chain_ids, + data=jdata, + method_args=sampler_args, + ) + runset = RunSet(args=cmdstan_args, chains=1) + base_file = runset._base_outfile + assert len(runset.metric_files) == 1 + assert runset.metric_files[0].endswith(f"{base_file}_metric.json") + + # Multi-chain + chain_ids = [1, 2] + cmdstan_args = CmdStanArgs( + model_name='bernoulli', + model_exe=exe, + chain_ids=chain_ids, + data=jdata, + method_args=sampler_args, + ) + runset = RunSet(args=cmdstan_args, chains=2) + assert len(runset.metric_files) == 2 + assert all( + f.endswith(f"{base_file}_{i}_metric.json") + for i, f in zip(chain_ids, runset.metric_files) + ) + + runset = RunSet(args=cmdstan_args, chains=2, one_process_per_chain=False) + assert len(runset.metric_files) == 2 + assert all( + f.endswith(f"{base_file}_metric_{i}.json") + for i, f in zip(chain_ids, runset.metric_files) + ) + + # Non-sampler + pf_args = PathfinderArgs() + chain_ids = [1] + cmdstan_args = CmdStanArgs( + model_name='bernoulli', + model_exe=exe, + chain_ids=chain_ids, + data=jdata, + method_args=pf_args, + ) + runset = RunSet(args=cmdstan_args, chains=1) + assert len(runset.metric_files) == 0 diff --git a/test/test_sample.py b/test/test_sample.py index 92d8fefa..b8560914 100644 --- a/test/test_sample.py +++ b/test/test_sample.py @@ -842,7 +842,15 @@ def test_validate_big_run() -> None: runset = RunSet(args=cmdstan_args, chains=2) runset._csv_files = [ os.path.join(DATAFILES_PATH, 'runset-big', 'output_icar_nyc-1.csv'), - os.path.join(DATAFILES_PATH, 'runset-big', 'output_icar_nyc-1.csv'), + os.path.join(DATAFILES_PATH, 'runset-big', 'output_icar_nyc-2.csv'), + ] + runset._metric_files = [ + os.path.join( + DATAFILES_PATH, 'runset-big', 'output_icar_nyc-1_metric.json' + ), + os.path.join( + DATAFILES_PATH, 'runset-big', 'output_icar_nyc-2_metric.json' + ), ] fit = CmdStanMCMC(runset) phis = ['phi[{}]'.format(str(x + 1)) for x in range(2095)] @@ -1743,6 +1751,12 @@ def test_metadata() -> None: os.path.join(DATAFILES_PATH, 'logistic_output_3.csv'), os.path.join(DATAFILES_PATH, 'logistic_output_4.csv'), ] + runset._metric_files = [ + os.path.join(DATAFILES_PATH, 'logistic_output_1_metric.json'), + os.path.join(DATAFILES_PATH, 'logistic_output_2_metric.json'), + os.path.join(DATAFILES_PATH, 'logistic_output_3_metric.json'), + os.path.join(DATAFILES_PATH, 'logistic_output_4_metric.json'), + ] retcodes = runset._retcodes for i in range(len(retcodes)): runset._set_retcode(i, 0) diff --git a/test/test_stancsv.py b/test/test_stancsv.py index a2f4a0e0..69e4ba4a 100644 --- a/test/test_stancsv.py +++ b/test/test_stancsv.py @@ -105,75 +105,6 @@ def test_parse_comments_header_and_draws() -> None: assert draws_lines == [b"3\n"] -def test_parsing_adaptation_lines() -> None: - lines = [ - b"# Adaptation terminated\n", - b"# Step size = 0.787025\n", - b"# Diagonal elements of inverse mass matrix:\n", - b"# 1\n", - b"# Elapsed Time\n", - ] - step_size, mass_matrix = stancsv.parse_hmc_adaptation_lines(lines) - assert step_size == 0.787025 - print(mass_matrix) - assert mass_matrix == 1 - - -def test_parsing_adaptation_lines_diagonal() -> None: - lines = [ - b"diag_e", # Will be present in the Stan CSV config - b"# Adaptation terminated\n", - b"# Step size = 0.787025\n", - b"# Diagonal elements of inverse mass matrix:\n", - b"# 1,2,3\n", - ] - step_size, mass_matrix = stancsv.parse_hmc_adaptation_lines(lines) - assert step_size == 0.787025 - assert mass_matrix is not None - assert np.array_equal(mass_matrix, np.array([1, 2, 3])) - - -def test_parsing_adaptation_lines_dense() -> None: - lines = [ - b"# Adaptation terminated\n", - b"# Step size = 0.775147\n", - b"# Elements of inverse mass matrix:\n", - b"# 2.84091, 0.230843, 0.0509365\n", - b"# 0.230843, 3.92459, 0.126989\n", - b"# 0.0509365, 0.126989, 3.82718\n", - ] - step_size, mass_matrix = stancsv.parse_hmc_adaptation_lines(lines) - expected = np.array( - [ - [2.84091, 0.230843, 0.0509365], - [0.230843, 3.92459, 0.126989], - [0.0509365, 0.126989, 3.82718], - ], - dtype=np.float64, - ) - assert step_size == 0.775147 - assert mass_matrix is not None - assert np.array_equal(mass_matrix, expected) - - -def test_parsing_adaptation_lines_missing_everything() -> None: - lines = [ - b"# Adaptation terminated\n", - b"# Elements of inverse mass matrix:\n", - ] - assert stancsv.parse_hmc_adaptation_lines(lines) == (None, None) - - -def test_parsing_adaptation_lines_no_free_params() -> None: - lines = [ - b"# Adaptation terminated\n", - b"# Step size = 1.77497\n", - b"# No free parameters for unit metric\n", - ] - _, mass_matrix = stancsv.parse_hmc_adaptation_lines(lines) - assert mass_matrix is None - - def test_csv_polars_and_numpy_equiv() -> None: lines = [ b"-6.76206,1,0.787025,1,1,0,6.81411,0.229458\n", @@ -512,138 +443,6 @@ def test_inconsistent_draws_shape_empty() -> None: stancsv.raise_on_inconsistent_draws_shape("", []) -def test_invalid_adaptation_block_good() -> None: - csv_path = os.path.join(DATAFILES_PATH, "bernoulli_output_1.csv") - comments, *_ = stancsv.parse_comments_header_and_draws(csv_path) - stancsv.raise_on_invalid_adaptation_block(comments) - - -def test_invalid_adaptation_block_missing() -> None: - lines = [ - b"# metric = diag_e (Default)\n", - ( - b"lp__,accept_stat__,stepsize__,treedepth__," - b"n_leapfrog__,divergent__,energy__,theta\n" - ), - b"-6.76206,1,0.787025,1,1,0,6.81411,0.229458\n", - b"# \n", - b"# Elapsed Time: 0.001332 seconds (Warm-up)\n", - ] - with pytest.raises(ValueError, match="expecting metric"): - stancsv.raise_on_invalid_adaptation_block(lines) - - -def test_invalid_adaptation_block_no_metric() -> None: - lines = [ - ( - b"lp__,accept_stat__,stepsize__,treedepth__," - b"n_leapfrog__,divergent__,energy__,theta\n" - ), - b"# Adaptation terminated\n", - b"# Step size = 0.787025\n", - b"# Diagonal elements of inverse mass matrix:\n", - b"# 1\n", - ] - with pytest.raises(ValueError, match="No reported metric"): - stancsv.raise_on_invalid_adaptation_block(lines) - - -def test_invalid_adaptation_block_invalid_step_size() -> None: - lines = [ - b"# metric = diag_e (Default)\n", - ( - b"lp__,accept_stat__,stepsize__,treedepth__," - b"n_leapfrog__,divergent__,energy__,theta\n" - ), - b"# Adaptation terminated\n", - b"# Step size = bad\n", - b"# Diagonal elements of inverse mass matrix:\n", - b"# 1\n", - ] - with pytest.raises(ValueError, match="invalid step size"): - stancsv.raise_on_invalid_adaptation_block(lines) - - -def test_invalid_adaptation_block_mismatched_structure() -> None: - lines = [ - b"# metric = diag_e (Default)\n", - ( - b"lp__,accept_stat__,stepsize__,treedepth__," - b"n_leapfrog__,divergent__,energy__,theta\n" - ), - b"# Adaptation terminated\n", - b"# Step size = 0.787025\n", - b"# Elements of inverse mass matrix:\n", - b"# 1\n", - ] - with pytest.raises(ValueError, match="invalid or missing"): - stancsv.raise_on_invalid_adaptation_block(lines) - - -def test_invalid_adaptation_block_missing_step_size() -> None: - lines = [ - b"# metric = diag_e (Default)\n", - ( - b"lp__,accept_stat__,stepsize__,treedepth__," - b"n_leapfrog__,divergent__,energy__,theta\n" - ), - b"# Adaptation terminated\n", - b"# Diagonal elements of inverse mass matrix:\n", - b"# 1\n", - ] - with pytest.raises(ValueError, match="expecting step size"): - stancsv.raise_on_invalid_adaptation_block(lines) - - -def test_invalid_adaptation_block_unit_e() -> None: - lines = [ - b"# metric = unit_e\n", - ( - b"lp__,accept_stat__,stepsize__,treedepth__," - b"n_leapfrog__,divergent__,energy__,theta\n" - ), - b"# Adaptation terminated\n", - b"# Step size = 1.77497\n", - b"# No free parameters for unit metric\n", - ] - stancsv.raise_on_invalid_adaptation_block(lines) - - -def test_invalid_adaptation_block_dense_e_valid() -> None: - lines = [ - b"# metric = dense_e\n", - ( - b"lp__,accept_stat__,stepsize__,treedepth__," - b"n_leapfrog__,divergent__,energy__,theta.1,theta.2,theta.3\n" - ), - b"# Adaptation terminated\n", - b"# Step size = 0.775147\n", - b"# Elements of inverse mass matrix:\n", - b"# 2.84091, 0.230843, 0.0509365\n", - b"# 0.230843, 3.92459, 0.126989\n", - b"# 0.0509365, 0.126989, 3.82718\n", - ] - stancsv.raise_on_invalid_adaptation_block(lines) - - -def test_invalid_adaptation_block_dense_e_invalid() -> None: - lines = [ - b"# metric = dense_e\n", - ( - b"lp__,accept_stat__,stepsize__,treedepth__," - b"n_leapfrog__,divergent__,energy__,theta.1,theta.2,theta.3\n" - ), - b"# Adaptation terminated\n", - b"# Step size = 0.775147\n", - b"# Elements of inverse mass matrix:\n", - b"# 2.84091, 0.230843, 0.0509365\n", - b"# 2.84091, 0.230843\n", - b"# 0.230843, 3.92459\n", - ] - with pytest.raises(ValueError, match="invalid or missing"): - stancsv.raise_on_invalid_adaptation_block(lines) - - def test_parsing_timing_lines() -> None: lines = [ b"# \n", diff --git a/test/test_utils.py b/test/test_utils.py index dcf687b8..d5c15d23 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -337,34 +337,6 @@ def test_check_sampler_csv_4() -> None: check_sampler_csv(csv_bad) -def test_check_sampler_csv_metric_1() -> None: - csv_bad = os.path.join(DATAFILES_PATH, 'output_bad_metric_1.csv') - with raises_nested(Exception, 'expecting metric'): - check_sampler_csv(csv_bad) - - -def test_check_sampler_csv_metric_2() -> None: - csv_bad = os.path.join(DATAFILES_PATH, 'output_bad_metric_2.csv') - with raises_nested(Exception, 'invalid step size'): - check_sampler_csv(csv_bad) - - -def test_check_sampler_csv_metric_3() -> None: - csv_bad = os.path.join(DATAFILES_PATH, 'output_bad_metric_3.csv') - with raises_nested( - Exception, 'invalid or missing mass matrix specification' - ): - check_sampler_csv(csv_bad) - - -def test_check_sampler_csv_metric_4() -> None: - csv_bad = os.path.join(DATAFILES_PATH, 'output_bad_metric_4.csv') - with raises_nested( - Exception, 'invalid or missing mass matrix specification' - ): - check_sampler_csv(csv_bad) - - def test_check_sampler_csv_thin() -> None: stan = os.path.join(DATAFILES_PATH, 'bernoulli.stan') bern_model = CmdStanModel(stan_file=stan)