Compare commits
43 Commits
Author | SHA1 | Date | |
---|---|---|---|
ce90f6774b
|
|||
48e41cbd2c
|
|||
603c5607f7
|
|||
bb72e903d1
|
|||
65e1948835
|
|||
310977e9b8
|
|||
b10586bf55
|
|||
1741807be4
|
|||
9a4548def4
|
|||
b4e5f53726
|
|||
f7559b2c4f
|
|||
9a7a3ff2c7
|
|||
c4805806be
|
|||
161bcf42ad
|
|||
8e6ead416c
|
|||
e6defc7948
|
|||
33d5da6a4f
|
|||
1110372a55
|
|||
e6a00d6b8f
|
|||
57cd746e5c
|
|||
878e16286b
|
|||
4726ccfb8c
|
|||
598dad1e6d
|
|||
01c0d7e49b
|
|||
a170a3ce01
|
|||
9bb8fc50fe
|
|||
f775ed34c6
|
|||
7d0c2b22cc | |||
d6e6876a79
|
|||
fccf50eb27
|
|||
33cab9ab41
|
|||
ad521ba472
|
|||
266d6dd583
|
|||
c573f8806d | |||
a015daf5ff
|
|||
a089951bbe
|
|||
7568aef842
|
|||
c4b6cbbb6f | |||
1cf4454153
|
|||
bf15f4a7b7
|
|||
12903b2540
|
|||
959b9af378
|
|||
8fd1b75e13
|
2
.flake8
2
.flake8
@@ -1,3 +1,3 @@
|
|||||||
[flake8]
|
[flake8]
|
||||||
ignore = W191, E501, W503
|
ignore = W191, E501, W503, E203
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
|
100
CHANGELOG.md
100
CHANGELOG.md
@@ -2,6 +2,106 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.7.7](https://gitea.deepak.science:2222/physics/deepdog/compare/0.7.6...0.7.7) (2024-02-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fixes phase calculation issue with setting input array ([48e41cb](https://gitea.deepak.science:2222/physics/deepdog/commit/48e41cbd2c58d4c4d2747822d618d7d55257643d))
|
||||||
|
|
||||||
|
### [0.7.6](https://gitea.deepak.science:2222/physics/deepdog/compare/0.7.5...0.7.6) (2024-02-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds ability to use phase measurements only for correlations ([bb72e90](https://gitea.deepak.science:2222/physics/deepdog/commit/bb72e903d14704a3783daf2dbc1797b90880aa85))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fixes typeerror vs indexerror on bare float as cost in subset simulation ([65e1948](https://gitea.deepak.science:2222/physics/deepdog/commit/65e19488359d7f5656660da7da8f32ed474989c3))
|
||||||
|
|
||||||
|
### [0.7.5](https://gitea.deepak.science:2222/physics/deepdog/compare/0.7.4...0.7.5) (2023-12-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds direct monte carlo package ([1741807](https://gitea.deepak.science:2222/physics/deepdog/commit/1741807be43d08fb51bc94518dd3b67585c04c20))
|
||||||
|
* adds longchain logging if logging last generation ([b4e5f53](https://gitea.deepak.science:2222/physics/deepdog/commit/b4e5f5372682fc64c3734a96c4a899e018f127ce))
|
||||||
|
* allows disabling timestamp in subset simulation bayes results ([9a4548d](https://gitea.deepak.science:2222/physics/deepdog/commit/9a4548def45a01f1f518135d4237c3dc09dcc342))
|
||||||
|
|
||||||
|
### [0.7.4](https://gitea.deepak.science:2222/physics/deepdog/compare/0.7.3...0.7.4) (2023-07-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds configurable chunk size for the initial mc level 0 SS stage cost calculation to reduce memory usage ([9a7a3ff](https://gitea.deepak.science:2222/physics/deepdog/commit/9a7a3ff2c7ebe81d5e10647ce39844c372ff7b07))
|
||||||
|
* allows for deepdog bayesrun with ss to not print csv to make snapshot testing possible ([8e6ead4](https://gitea.deepak.science:2222/physics/deepdog/commit/8e6ead416c9eba56f568f648d0df44caaa510cfe))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fixes bug if case of clamping necessary ([161bcf4](https://gitea.deepak.science:2222/physics/deepdog/commit/161bcf42addf331661c3929073688b9f2c13502c))
|
||||||
|
* fixes bug with clamped probabilities being underestimated ([e6defc7](https://gitea.deepak.science:2222/physics/deepdog/commit/e6defc794871a48ac331023eb477bd235b78d6d0))
|
||||||
|
|
||||||
|
### [0.7.3](https://gitea.deepak.science:2222/physics/deepdog/compare/0.7.2...0.7.3) (2023-07-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds utility options and avoids memory leak ([598dad1](https://gitea.deepak.science:2222/physics/deepdog/commit/598dad1e6dc8fc0b7a5b4a90c8e17bf744e8d98c))
|
||||||
|
|
||||||
|
### [0.7.2](https://gitea.deepak.science:2222/physics/deepdog/compare/0.7.1...0.7.2) (2023-07-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* clamps results now ([9bb8fc5](https://gitea.deepak.science:2222/physics/deepdog/commit/9bb8fc50fe1bd1a285a333c5a396bfb6ac3176cf))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fixes clamping format etc. ([a170a3c](https://gitea.deepak.science:2222/physics/deepdog/commit/a170a3ce01adcec356e5aaab9abcc0ec4accd64b))
|
||||||
|
|
||||||
|
### [0.7.1](https://gitea.deepak.science:2222/physics/deepdog/compare/0.7.0...0.7.1) (2023-07-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds subset simulation stuff ([33cab9a](https://gitea.deepak.science:2222/physics/deepdog/commit/33cab9ab4179cec13ae9e591a8ffc32df4dda989))
|
||||||
|
|
||||||
|
## [0.7.0](https://gitea.deepak.science:2222/physics/deepdog/compare/0.6.7...0.7.0) (2023-05-01)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* removes fastfilter parameter because it should never be needed
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds pair capability to real spectrum run hopefully ([a089951](https://gitea.deepak.science:2222/physics/deepdog/commit/a089951bbefcd8a0b2efeb49b7a8090412cbb23d))
|
||||||
|
* removes fastfilter parameter because it should never be needed ([a015daf](https://gitea.deepak.science:2222/physics/deepdog/commit/a015daf5ff6fa5f6155c8d7e02981b588840a5b0))
|
||||||
|
|
||||||
|
### [0.6.7](https://gitea.deepak.science:2222/physics/deepdog/compare/0.6.6...0.6.7) (2023-04-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds option to cap core count for real spectrum run ([bf15f4a](https://gitea.deepak.science:2222/physics/deepdog/commit/bf15f4a7b7f59504983624e7d512ed7474372032))
|
||||||
|
* adds option to cap core count for temp aware run ([12903b2](https://gitea.deepak.science:2222/physics/deepdog/commit/12903b2540cefb040174d230bc0d04719a6dc1b7))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* avoids redefinition of core count in loop ([1cf4454](https://gitea.deepak.science:2222/physics/deepdog/commit/1cf44541531541088198bd4599d467df3e1acbcf))
|
||||||
|
|
||||||
|
### [0.6.6](https://gitea.deepak.science:2222/physics/deepdog/compare/0.6.5...0.6.6) (2023-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* removes bad logging in multiprocessing function ([8fd1b75](https://gitea.deepak.science:2222/physics/deepdog/commit/8fd1b75e1378301210bfa8f14dd09174bbd21414))
|
||||||
|
|
||||||
### [0.6.5](https://gitea.deepak.science:2222/physics/deepdog/compare/0.6.4...0.6.5) (2023-04-09)
|
### [0.6.5](https://gitea.deepak.science:2222/physics/deepdog/compare/0.6.4...0.6.5) (2023-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -4,6 +4,7 @@ from deepdog.bayes_run import BayesRun
|
|||||||
from deepdog.bayes_run_simulpairs import BayesRunSimulPairs
|
from deepdog.bayes_run_simulpairs import BayesRunSimulPairs
|
||||||
from deepdog.real_spectrum_run import RealSpectrumRun
|
from deepdog.real_spectrum_run import RealSpectrumRun
|
||||||
from deepdog.temp_aware_real_spectrum_run import TempAwareRealSpectrumRun
|
from deepdog.temp_aware_real_spectrum_run import TempAwareRealSpectrumRun
|
||||||
|
from deepdog.bayes_run_with_ss import BayesRunWithSubspaceSimulation
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
@@ -16,6 +17,7 @@ __all__ = [
|
|||||||
"BayesRunSimulPairs",
|
"BayesRunSimulPairs",
|
||||||
"RealSpectrumRun",
|
"RealSpectrumRun",
|
||||||
"TempAwareRealSpectrumRun",
|
"TempAwareRealSpectrumRun",
|
||||||
|
"BayesRunWithSubspaceSimulation",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
261
deepdog/bayes_run_with_ss.py
Normal file
261
deepdog/bayes_run_with_ss.py
Normal file
@@ -0,0 +1,261 @@
|
|||||||
|
import deepdog.subset_simulation
|
||||||
|
import pdme.inputs
|
||||||
|
import pdme.model
|
||||||
|
import pdme.measurement.input_types
|
||||||
|
import pdme.measurement.oscillating_dipole
|
||||||
|
import pdme.util.fast_v_calc
|
||||||
|
import pdme.util.fast_nonlocal_spectrum
|
||||||
|
from typing import Sequence, Tuple, List, Optional
|
||||||
|
import datetime
|
||||||
|
import csv
|
||||||
|
import logging
|
||||||
|
import numpy
|
||||||
|
import numpy.typing
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: remove hardcode
|
||||||
|
CHUNKSIZE = 50
|
||||||
|
|
||||||
|
# TODO: It's garbage to have this here duplicated from pdme.
|
||||||
|
DotInput = Tuple[numpy.typing.ArrayLike, float]
|
||||||
|
|
||||||
|
|
||||||
|
CLAMPING_FACTOR = 10
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class BayesRunWithSubspaceSimulation:
|
||||||
|
"""
|
||||||
|
A single Bayes run for a given set of dots.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
dot_inputs : Sequence[DotInput]
|
||||||
|
The dot inputs for this bayes run.
|
||||||
|
|
||||||
|
models_with_names : Sequence[Tuple(str, pdme.model.DipoleModel)]
|
||||||
|
The models to evaluate.
|
||||||
|
|
||||||
|
actual_model : pdme.model.DipoleModel
|
||||||
|
The model which is actually correct.
|
||||||
|
|
||||||
|
filename_slug : str
|
||||||
|
The filename slug to include.
|
||||||
|
|
||||||
|
run_count: int
|
||||||
|
The number of runs to do.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
dot_positions: Sequence[numpy.typing.ArrayLike],
|
||||||
|
frequency_range: Sequence[float],
|
||||||
|
models_with_names: Sequence[Tuple[str, pdme.model.DipoleModel]],
|
||||||
|
actual_model: pdme.model.DipoleModel,
|
||||||
|
filename_slug: str,
|
||||||
|
max_frequency: float = 20,
|
||||||
|
end_threshold: float = None,
|
||||||
|
run_count=100,
|
||||||
|
chunksize: int = CHUNKSIZE,
|
||||||
|
ss_n_c: int = 500,
|
||||||
|
ss_n_s: int = 100,
|
||||||
|
ss_m_max: int = 15,
|
||||||
|
ss_target_cost: Optional[float] = None,
|
||||||
|
ss_level_0_seed: int = 200,
|
||||||
|
ss_mcmc_seed: int = 20,
|
||||||
|
ss_use_adaptive_steps=True,
|
||||||
|
ss_default_phi_step=0.01,
|
||||||
|
ss_default_theta_step=0.01,
|
||||||
|
ss_default_r_step=0.01,
|
||||||
|
ss_default_w_log_step=0.01,
|
||||||
|
ss_default_upper_w_log_step=4,
|
||||||
|
ss_dump_last_generation=False,
|
||||||
|
ss_initial_costs_chunk_size=100,
|
||||||
|
write_output_to_bayesruncsv=True,
|
||||||
|
use_timestamp_for_output=True,
|
||||||
|
) -> None:
|
||||||
|
self.dot_inputs = pdme.inputs.inputs_with_frequency_range(
|
||||||
|
dot_positions, frequency_range
|
||||||
|
)
|
||||||
|
self.dot_inputs_array = pdme.measurement.input_types.dot_inputs_to_array(
|
||||||
|
self.dot_inputs
|
||||||
|
)
|
||||||
|
|
||||||
|
self.models_with_names = models_with_names
|
||||||
|
self.models = [model for (_, model) in models_with_names]
|
||||||
|
self.model_names = [name for (name, _) in models_with_names]
|
||||||
|
self.actual_model = actual_model
|
||||||
|
|
||||||
|
self.n: int
|
||||||
|
try:
|
||||||
|
self.n = self.actual_model.n # type: ignore
|
||||||
|
except AttributeError:
|
||||||
|
self.n = 1
|
||||||
|
|
||||||
|
self.model_count = len(self.models)
|
||||||
|
|
||||||
|
self.csv_fields = []
|
||||||
|
for i in range(self.n):
|
||||||
|
self.csv_fields.extend(
|
||||||
|
[
|
||||||
|
f"dipole_moment_{i+1}",
|
||||||
|
f"dipole_location_{i+1}",
|
||||||
|
f"dipole_frequency_{i+1}",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
self.compensate_zeros = True
|
||||||
|
self.chunksize = chunksize
|
||||||
|
for name in self.model_names:
|
||||||
|
self.csv_fields.extend([f"{name}_likelihood", f"{name}_prob"])
|
||||||
|
|
||||||
|
self.probabilities = [1 / self.model_count] * self.model_count
|
||||||
|
|
||||||
|
if use_timestamp_for_output:
|
||||||
|
timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
|
||||||
|
self.filename = f"{timestamp}-{filename_slug}.bayesrunwithss.csv"
|
||||||
|
else:
|
||||||
|
self.filename = f"{filename_slug}.bayesrunwithss.csv"
|
||||||
|
self.max_frequency = max_frequency
|
||||||
|
|
||||||
|
if end_threshold is not None:
|
||||||
|
if 0 < end_threshold < 1:
|
||||||
|
self.end_threshold: float = end_threshold
|
||||||
|
self.use_end_threshold = True
|
||||||
|
_logger.info(f"Will abort early, at {self.end_threshold}.")
|
||||||
|
else:
|
||||||
|
raise ValueError(
|
||||||
|
f"end_threshold should be between 0 and 1, but is actually {end_threshold}"
|
||||||
|
)
|
||||||
|
|
||||||
|
self.ss_n_c = ss_n_c
|
||||||
|
self.ss_n_s = ss_n_s
|
||||||
|
self.ss_m_max = ss_m_max
|
||||||
|
self.ss_target_cost = ss_target_cost
|
||||||
|
self.ss_level_0_seed = ss_level_0_seed
|
||||||
|
self.ss_mcmc_seed = ss_mcmc_seed
|
||||||
|
self.ss_use_adaptive_steps = ss_use_adaptive_steps
|
||||||
|
self.ss_default_phi_step = ss_default_phi_step
|
||||||
|
self.ss_default_theta_step = ss_default_theta_step
|
||||||
|
self.ss_default_r_step = ss_default_r_step
|
||||||
|
self.ss_default_w_log_step = ss_default_w_log_step
|
||||||
|
self.ss_default_upper_w_log_step = ss_default_upper_w_log_step
|
||||||
|
self.ss_dump_last_generation = ss_dump_last_generation
|
||||||
|
self.ss_initial_costs_chunk_size = ss_initial_costs_chunk_size
|
||||||
|
self.run_count = run_count
|
||||||
|
|
||||||
|
self.write_output_to_csv = write_output_to_bayesruncsv
|
||||||
|
|
||||||
|
def go(self) -> Sequence:
|
||||||
|
|
||||||
|
if self.write_output_to_csv:
|
||||||
|
with open(self.filename, "a", newline="") as outfile:
|
||||||
|
writer = csv.DictWriter(
|
||||||
|
outfile, fieldnames=self.csv_fields, dialect="unix"
|
||||||
|
)
|
||||||
|
writer.writeheader()
|
||||||
|
|
||||||
|
return_result = []
|
||||||
|
|
||||||
|
for run in range(1, self.run_count + 1):
|
||||||
|
|
||||||
|
# Generate the actual dipoles
|
||||||
|
actual_dipoles = self.actual_model.get_dipoles(self.max_frequency)
|
||||||
|
|
||||||
|
measurements = actual_dipoles.get_dot_measurements(self.dot_inputs)
|
||||||
|
|
||||||
|
_logger.info(f"Going to work on dipole at {actual_dipoles.dipoles}")
|
||||||
|
|
||||||
|
# define a new seed sequence for each run
|
||||||
|
|
||||||
|
results = []
|
||||||
|
_logger.debug("Going to iterate over models now")
|
||||||
|
for model_count, model in enumerate(self.models_with_names):
|
||||||
|
_logger.debug(f"Doing model #{model_count}, {model[0]}")
|
||||||
|
subset_run = deepdog.subset_simulation.SubsetSimulation(
|
||||||
|
model,
|
||||||
|
self.dot_inputs,
|
||||||
|
measurements,
|
||||||
|
self.ss_n_c,
|
||||||
|
self.ss_n_s,
|
||||||
|
self.ss_m_max,
|
||||||
|
self.ss_target_cost,
|
||||||
|
self.ss_level_0_seed,
|
||||||
|
self.ss_mcmc_seed,
|
||||||
|
self.ss_use_adaptive_steps,
|
||||||
|
self.ss_default_phi_step,
|
||||||
|
self.ss_default_theta_step,
|
||||||
|
self.ss_default_r_step,
|
||||||
|
self.ss_default_w_log_step,
|
||||||
|
self.ss_default_upper_w_log_step,
|
||||||
|
initial_cost_chunk_size=self.ss_initial_costs_chunk_size,
|
||||||
|
keep_probs_list=False,
|
||||||
|
dump_last_generation_to_file=self.ss_dump_last_generation,
|
||||||
|
)
|
||||||
|
results.append(subset_run.execute())
|
||||||
|
|
||||||
|
_logger.debug("Done, constructing output now")
|
||||||
|
row = {
|
||||||
|
"dipole_moment_1": actual_dipoles.dipoles[0].p,
|
||||||
|
"dipole_location_1": actual_dipoles.dipoles[0].s,
|
||||||
|
"dipole_frequency_1": actual_dipoles.dipoles[0].w,
|
||||||
|
}
|
||||||
|
for i in range(1, self.n):
|
||||||
|
try:
|
||||||
|
current_dipoles = actual_dipoles.dipoles[i]
|
||||||
|
row[f"dipole_moment_{i+1}"] = current_dipoles.p
|
||||||
|
row[f"dipole_location_{i+1}"] = current_dipoles.s
|
||||||
|
row[f"dipole_frequency_{i+1}"] = current_dipoles.w
|
||||||
|
except IndexError:
|
||||||
|
_logger.info(f"Not writing anymore, saw end after {i}")
|
||||||
|
break
|
||||||
|
|
||||||
|
likelihoods: List[float] = []
|
||||||
|
|
||||||
|
for (name, result) in zip(self.model_names, results):
|
||||||
|
if result.over_target_likelihood is None:
|
||||||
|
if result.lowest_likelihood is None:
|
||||||
|
_logger.error(f"result {result} looks bad")
|
||||||
|
clamped_likelihood = 10**-15
|
||||||
|
else:
|
||||||
|
clamped_likelihood = result.lowest_likelihood / CLAMPING_FACTOR
|
||||||
|
_logger.warning(
|
||||||
|
f"got a none result, clamping to {clamped_likelihood}"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
clamped_likelihood = result.over_target_likelihood
|
||||||
|
likelihoods.append(clamped_likelihood)
|
||||||
|
row[f"{name}_likelihood"] = clamped_likelihood
|
||||||
|
|
||||||
|
success_weight = sum(
|
||||||
|
[
|
||||||
|
likelihood * prob
|
||||||
|
for likelihood, prob in zip(likelihoods, self.probabilities)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
new_probabilities = [
|
||||||
|
likelihood * old_prob / success_weight
|
||||||
|
for likelihood, old_prob in zip(likelihoods, self.probabilities)
|
||||||
|
]
|
||||||
|
self.probabilities = new_probabilities
|
||||||
|
for name, probability in zip(self.model_names, self.probabilities):
|
||||||
|
row[f"{name}_prob"] = probability
|
||||||
|
_logger.info(row)
|
||||||
|
return_result.append(row)
|
||||||
|
|
||||||
|
if self.write_output_to_csv:
|
||||||
|
with open(self.filename, "a", newline="") as outfile:
|
||||||
|
writer = csv.DictWriter(
|
||||||
|
outfile, fieldnames=self.csv_fields, dialect="unix"
|
||||||
|
)
|
||||||
|
writer.writerow(row)
|
||||||
|
|
||||||
|
if self.use_end_threshold:
|
||||||
|
max_prob = max(self.probabilities)
|
||||||
|
if max_prob > self.end_threshold:
|
||||||
|
_logger.info(
|
||||||
|
f"Aborting early, because {max_prob} is greater than {self.end_threshold}"
|
||||||
|
)
|
||||||
|
break
|
||||||
|
|
||||||
|
return return_result
|
6
deepdog/direct_monte_carlo/__init__.py
Normal file
6
deepdog/direct_monte_carlo/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from deepdog.direct_monte_carlo.direct_mc import (
|
||||||
|
DirectMonteCarloRun,
|
||||||
|
DirectMonteCarloConfig,
|
||||||
|
)
|
||||||
|
|
||||||
|
__all__ = ["DirectMonteCarloRun", "DirectMonteCarloConfig"]
|
157
deepdog/direct_monte_carlo/direct_mc.py
Normal file
157
deepdog/direct_monte_carlo/direct_mc.py
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
import pdme.model
|
||||||
|
import pdme.measurement
|
||||||
|
import pdme.measurement.input_types
|
||||||
|
import pdme.subspace_simulation
|
||||||
|
from typing import Tuple, Sequence
|
||||||
|
from dataclasses import dataclass
|
||||||
|
import logging
|
||||||
|
import numpy
|
||||||
|
import numpy.random
|
||||||
|
import pdme.util.fast_v_calc
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class DirectMonteCarloResult:
|
||||||
|
successes: int
|
||||||
|
monte_carlo_count: int
|
||||||
|
likelihood: float
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class DirectMonteCarloConfig:
|
||||||
|
monte_carlo_count_per_cycle: int = 10000
|
||||||
|
monte_carlo_cycles: int = 10
|
||||||
|
target_success: int = 100
|
||||||
|
max_monte_carlo_cycles_steps: int = 10
|
||||||
|
monte_carlo_seed: int = 1234
|
||||||
|
write_successes_to_file: bool = False
|
||||||
|
tag: str = ""
|
||||||
|
|
||||||
|
|
||||||
|
class DirectMonteCarloRun:
|
||||||
|
"""
|
||||||
|
A single model Direct Monte Carlo run, currently implemented only using single threading.
|
||||||
|
An encapsulation of the steps needed for a Bayes run.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
model_name_pair : Sequence[Tuple(str, pdme.model.DipoleModel)]
|
||||||
|
The model to evaluate, with name.
|
||||||
|
|
||||||
|
measurements: Sequence[pdme.measurement.DotRangeMeasurement]
|
||||||
|
The measurements as dot ranges to use as the bounds for the Monte Carlo calculation.
|
||||||
|
|
||||||
|
monte_carlo_count_per_cycle: int
|
||||||
|
The number of Monte Carlo iterations to use in a single cycle calculation.
|
||||||
|
|
||||||
|
monte_carlo_cycles: int
|
||||||
|
The number of cycles to use in each step.
|
||||||
|
Increasing monte_carlo_count_per_cycle increases memory usage (and runtime), while this increases runtime, allowing
|
||||||
|
control over memory use.
|
||||||
|
|
||||||
|
target_success: int
|
||||||
|
The number of successes to target before exiting early.
|
||||||
|
Should likely be ~100 but can go higher to.
|
||||||
|
|
||||||
|
max_monte_carlo_cycles_steps: int
|
||||||
|
The number of steps to use. Each step consists of monte_carlo_cycles cycles, each of which has monte_carlo_count_per_cycle iterations.
|
||||||
|
|
||||||
|
monte_carlo_seed: int
|
||||||
|
The seed to use for the RNG.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
model_name_pair: Tuple[str, pdme.model.DipoleModel],
|
||||||
|
measurements: Sequence[pdme.measurement.DotRangeMeasurement],
|
||||||
|
config: DirectMonteCarloConfig,
|
||||||
|
):
|
||||||
|
self.model_name, self.model = model_name_pair
|
||||||
|
|
||||||
|
self.measurements = measurements
|
||||||
|
self.dot_inputs = [(measure.r, measure.f) for measure in self.measurements]
|
||||||
|
|
||||||
|
self.dot_inputs_array = pdme.measurement.input_types.dot_inputs_to_array(
|
||||||
|
self.dot_inputs
|
||||||
|
)
|
||||||
|
|
||||||
|
self.config = config
|
||||||
|
(
|
||||||
|
self.lows,
|
||||||
|
self.highs,
|
||||||
|
) = pdme.measurement.input_types.dot_range_measurements_low_high_arrays(
|
||||||
|
self.measurements
|
||||||
|
)
|
||||||
|
|
||||||
|
def _single_run(self, seed) -> numpy.ndarray:
|
||||||
|
rng = numpy.random.default_rng(seed)
|
||||||
|
|
||||||
|
sample_dipoles = self.model.get_monte_carlo_dipole_inputs(
|
||||||
|
self.config.monte_carlo_count_per_cycle, -1, rng
|
||||||
|
)
|
||||||
|
|
||||||
|
current_sample = sample_dipoles
|
||||||
|
for di, low, high in zip(self.dot_inputs_array, self.lows, self.highs):
|
||||||
|
|
||||||
|
if len(current_sample) < 1:
|
||||||
|
break
|
||||||
|
vals = pdme.util.fast_v_calc.fast_vs_for_dipoleses(
|
||||||
|
numpy.array([di]), current_sample
|
||||||
|
)
|
||||||
|
|
||||||
|
current_sample = current_sample[
|
||||||
|
numpy.all((vals > low) & (vals < high), axis=1)
|
||||||
|
]
|
||||||
|
return current_sample
|
||||||
|
|
||||||
|
def execute(self) -> DirectMonteCarloResult:
|
||||||
|
step_count = 0
|
||||||
|
total_success = 0
|
||||||
|
total_count = 0
|
||||||
|
|
||||||
|
count_per_step = (
|
||||||
|
self.config.monte_carlo_count_per_cycle * self.config.monte_carlo_cycles
|
||||||
|
)
|
||||||
|
seed_sequence = numpy.random.SeedSequence(self.config.monte_carlo_seed)
|
||||||
|
while (step_count < self.config.max_monte_carlo_cycles_steps) and (
|
||||||
|
total_success < self.config.target_success
|
||||||
|
):
|
||||||
|
_logger.debug(f"Executing step {step_count}")
|
||||||
|
for cycle_i, seed in enumerate(
|
||||||
|
seed_sequence.spawn(self.config.monte_carlo_cycles)
|
||||||
|
):
|
||||||
|
cycle_success_configs = self._single_run(seed)
|
||||||
|
cycle_success_count = len(cycle_success_configs)
|
||||||
|
if cycle_success_count > 0:
|
||||||
|
_logger.debug(
|
||||||
|
f"For cycle {cycle_i} received {cycle_success_count} successes"
|
||||||
|
)
|
||||||
|
_logger.debug(cycle_success_configs)
|
||||||
|
if self.config.write_successes_to_file:
|
||||||
|
sorted_by_freq = numpy.array(
|
||||||
|
[
|
||||||
|
pdme.subspace_simulation.sort_array_of_dipoles_by_frequency(
|
||||||
|
dipole_config
|
||||||
|
)
|
||||||
|
for dipole_config in cycle_success_configs
|
||||||
|
]
|
||||||
|
)
|
||||||
|
dipole_count = numpy.array(cycle_success_configs).shape[1]
|
||||||
|
for n in range(dipole_count):
|
||||||
|
numpy.savetxt(
|
||||||
|
f"{self.config.tag}_{step_count}_{cycle_i}_dipole_{n}.csv",
|
||||||
|
sorted_by_freq[:, n],
|
||||||
|
delimiter=",",
|
||||||
|
)
|
||||||
|
total_success += cycle_success_count
|
||||||
|
_logger.debug(f"At end of step {step_count} have {total_success} successes")
|
||||||
|
step_count += 1
|
||||||
|
total_count += count_per_step
|
||||||
|
|
||||||
|
return DirectMonteCarloResult(
|
||||||
|
successes=total_success,
|
||||||
|
monte_carlo_count=total_count,
|
||||||
|
likelihood=total_success / total_count,
|
||||||
|
)
|
@@ -5,7 +5,7 @@ import pdme.measurement.input_types
|
|||||||
import pdme.measurement.oscillating_dipole
|
import pdme.measurement.oscillating_dipole
|
||||||
import pdme.util.fast_v_calc
|
import pdme.util.fast_v_calc
|
||||||
import pdme.util.fast_nonlocal_spectrum
|
import pdme.util.fast_nonlocal_spectrum
|
||||||
from typing import Sequence, Tuple, List, Dict, Union
|
from typing import Sequence, Tuple, List, Dict, Union, Optional
|
||||||
import datetime
|
import datetime
|
||||||
import csv
|
import csv
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
@@ -20,16 +20,86 @@ CHUNKSIZE = 50
|
|||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def get_a_result(input) -> int:
|
def get_a_result_fast_filter_pairs(input) -> int:
|
||||||
model, dot_inputs, lows, highs, monte_carlo_count, seed = input
|
(
|
||||||
|
model,
|
||||||
|
dot_inputs,
|
||||||
|
lows,
|
||||||
|
highs,
|
||||||
|
pair_inputs,
|
||||||
|
pair_lows,
|
||||||
|
pair_highs,
|
||||||
|
monte_carlo_count,
|
||||||
|
seed,
|
||||||
|
) = input
|
||||||
|
|
||||||
rng = numpy.random.default_rng(seed)
|
rng = numpy.random.default_rng(seed)
|
||||||
# TODO: A long term refactor is to pull the frequency stuff out from here. The None stands for max_frequency, which is unneeded in the actually useful models.
|
# TODO: A long term refactor is to pull the frequency stuff out from here. The None stands for max_frequency, which is unneeded in the actually useful models.
|
||||||
sample_dipoles = model.get_monte_carlo_dipole_inputs(
|
sample_dipoles = model.get_monte_carlo_dipole_inputs(
|
||||||
monte_carlo_count, None, rng_to_use=rng
|
monte_carlo_count, None, rng_to_use=rng
|
||||||
)
|
)
|
||||||
vals = pdme.util.fast_v_calc.fast_vs_for_dipoleses(dot_inputs, sample_dipoles)
|
|
||||||
return numpy.count_nonzero(pdme.util.fast_v_calc.between(vals, lows, highs))
|
current_sample = sample_dipoles
|
||||||
|
for di, low, high in zip(dot_inputs, lows, highs):
|
||||||
|
|
||||||
|
if len(current_sample) < 1:
|
||||||
|
break
|
||||||
|
vals = pdme.util.fast_v_calc.fast_vs_for_dipoleses(
|
||||||
|
numpy.array([di]), current_sample
|
||||||
|
)
|
||||||
|
|
||||||
|
current_sample = current_sample[numpy.all((vals > low) & (vals < high), axis=1)]
|
||||||
|
|
||||||
|
for pi, plow, phigh in zip(pair_inputs, pair_lows, pair_highs):
|
||||||
|
if len(current_sample) < 1:
|
||||||
|
break
|
||||||
|
vals = pdme.util.fast_nonlocal_spectrum.fast_s_nonlocal_dipoleses(
|
||||||
|
numpy.array([pi]), current_sample
|
||||||
|
)
|
||||||
|
|
||||||
|
current_sample = current_sample[
|
||||||
|
numpy.all(
|
||||||
|
((vals > plow) & (vals < phigh)) | ((vals < plow) & (vals > phigh)),
|
||||||
|
axis=1,
|
||||||
|
)
|
||||||
|
]
|
||||||
|
return len(current_sample)
|
||||||
|
|
||||||
|
|
||||||
|
def get_a_result_fast_filter_pair_phase_only(input) -> int:
|
||||||
|
(
|
||||||
|
model,
|
||||||
|
pair_inputs,
|
||||||
|
pair_phase_lows,
|
||||||
|
pair_phase_highs,
|
||||||
|
monte_carlo_count,
|
||||||
|
seed,
|
||||||
|
) = input
|
||||||
|
|
||||||
|
rng = numpy.random.default_rng(seed)
|
||||||
|
# TODO: A long term refactor is to pull the frequency stuff out from here. The None stands for max_frequency, which is unneeded in the actually useful models.
|
||||||
|
sample_dipoles = model.get_monte_carlo_dipole_inputs(
|
||||||
|
monte_carlo_count, None, rng_to_use=rng
|
||||||
|
)
|
||||||
|
|
||||||
|
current_sample = sample_dipoles
|
||||||
|
|
||||||
|
for pi, plow, phigh in zip(pair_inputs, pair_phase_lows, pair_phase_highs):
|
||||||
|
if len(current_sample) < 1:
|
||||||
|
break
|
||||||
|
vals = pdme.util.fast_nonlocal_spectrum.signarg(
|
||||||
|
pdme.util.fast_nonlocal_spectrum.fast_s_nonlocal_dipoleses(
|
||||||
|
numpy.array([pi]), current_sample
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
current_sample = current_sample[
|
||||||
|
numpy.all(
|
||||||
|
((vals > plow) & (vals < phigh)) | ((vals < plow) & (vals > phigh)),
|
||||||
|
axis=1,
|
||||||
|
)
|
||||||
|
]
|
||||||
|
return len(current_sample)
|
||||||
|
|
||||||
|
|
||||||
def get_a_result_fast_filter(input) -> int:
|
def get_a_result_fast_filter(input) -> int:
|
||||||
@@ -74,6 +144,11 @@ class RealSpectrumRun:
|
|||||||
|
|
||||||
run_count: int
|
run_count: int
|
||||||
The number of runs to do.
|
The number of runs to do.
|
||||||
|
|
||||||
|
If pair_measurements is not None, uses pair measurement method (and single measurements too).
|
||||||
|
If pair_phase_measurements is not None, ignores measurements and uses phase measurements _only_
|
||||||
|
This is lazy design on my part.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@@ -87,7 +162,13 @@ class RealSpectrumRun:
|
|||||||
max_monte_carlo_cycles_steps: int = 10,
|
max_monte_carlo_cycles_steps: int = 10,
|
||||||
chunksize: int = CHUNKSIZE,
|
chunksize: int = CHUNKSIZE,
|
||||||
initial_seed: int = 12345,
|
initial_seed: int = 12345,
|
||||||
use_fast_filter: bool = True,
|
cap_core_count: int = 0,
|
||||||
|
pair_measurements: Optional[
|
||||||
|
Sequence[pdme.measurement.DotPairRangeMeasurement]
|
||||||
|
] = None,
|
||||||
|
pair_phase_measurements: Optional[
|
||||||
|
Sequence[pdme.measurement.DotPairRangeMeasurement]
|
||||||
|
] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.measurements = measurements
|
self.measurements = measurements
|
||||||
self.dot_inputs = [(measure.r, measure.f) for measure in self.measurements]
|
self.dot_inputs = [(measure.r, measure.f) for measure in self.measurements]
|
||||||
@@ -96,6 +177,37 @@ class RealSpectrumRun:
|
|||||||
self.dot_inputs
|
self.dot_inputs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if pair_measurements is not None:
|
||||||
|
self.pair_measurements = pair_measurements
|
||||||
|
self.use_pair_measurements = True
|
||||||
|
self.use_pair_phase_measurements = False
|
||||||
|
|
||||||
|
self.dot_pair_inputs = [
|
||||||
|
(measure.r1, measure.r2, measure.f)
|
||||||
|
for measure in self.pair_measurements
|
||||||
|
]
|
||||||
|
self.dot_pair_inputs_array = (
|
||||||
|
pdme.measurement.input_types.dot_pair_inputs_to_array(
|
||||||
|
self.dot_pair_inputs
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif pair_phase_measurements is not None:
|
||||||
|
self.use_pair_measurements = False
|
||||||
|
self.use_pair_phase_measurements = True
|
||||||
|
self.pair_phase_measurements = pair_phase_measurements
|
||||||
|
self.dot_pair_inputs = [
|
||||||
|
(measure.r1, measure.r2, measure.f)
|
||||||
|
for measure in self.pair_measurements
|
||||||
|
]
|
||||||
|
self.dot_pair_inputs_array = (
|
||||||
|
pdme.measurement.input_types.dot_pair_inputs_to_array(
|
||||||
|
self.dot_pair_inputs
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.use_pair_measurements = False
|
||||||
|
self.use_pair_phase_measurements = False
|
||||||
|
|
||||||
self.models = [model for (_, model) in models_with_names]
|
self.models = [model for (_, model) in models_with_names]
|
||||||
self.model_names = [name for (name, _) in models_with_names]
|
self.model_names = [name for (name, _) in models_with_names]
|
||||||
self.model_count = len(self.models)
|
self.model_count = len(self.models)
|
||||||
@@ -116,13 +228,14 @@ class RealSpectrumRun:
|
|||||||
self.probabilities = [1 / self.model_count] * self.model_count
|
self.probabilities = [1 / self.model_count] * self.model_count
|
||||||
|
|
||||||
timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
|
timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
|
||||||
self.use_fast_filter = use_fast_filter
|
|
||||||
ff_string = "no_fast_filter"
|
ff_string = "fast_filter"
|
||||||
if self.use_fast_filter:
|
|
||||||
ff_string = "fast_filter"
|
|
||||||
self.filename = f"{timestamp}-{filename_slug}.realdata.{ff_string}.bayesrun.csv"
|
self.filename = f"{timestamp}-{filename_slug}.realdata.{ff_string}.bayesrun.csv"
|
||||||
self.initial_seed = initial_seed
|
self.initial_seed = initial_seed
|
||||||
|
|
||||||
|
self.cap_core_count = cap_core_count
|
||||||
|
|
||||||
def go(self) -> None:
|
def go(self) -> None:
|
||||||
with open(self.filename, "a", newline="") as outfile:
|
with open(self.filename, "a", newline="") as outfile:
|
||||||
writer = csv.DictWriter(outfile, fieldnames=self.csv_fields, dialect="unix")
|
writer = csv.DictWriter(outfile, fieldnames=self.csv_fields, dialect="unix")
|
||||||
@@ -135,16 +248,39 @@ class RealSpectrumRun:
|
|||||||
self.measurements
|
self.measurements
|
||||||
)
|
)
|
||||||
|
|
||||||
|
pair_lows = None
|
||||||
|
pair_highs = None
|
||||||
|
if self.use_pair_measurements:
|
||||||
|
(
|
||||||
|
pair_lows,
|
||||||
|
pair_highs,
|
||||||
|
) = pdme.measurement.input_types.dot_range_measurements_low_high_arrays(
|
||||||
|
self.pair_measurements
|
||||||
|
)
|
||||||
|
|
||||||
|
pair_phase_lows = None
|
||||||
|
pair_phase_highs = None
|
||||||
|
if self.use_pair_phase_measurements:
|
||||||
|
(
|
||||||
|
pair_phase_lows,
|
||||||
|
pair_phase_highs,
|
||||||
|
) = pdme.measurement.input_types.dot_range_measurements_low_high_arrays(
|
||||||
|
self.pair_phase_measurements
|
||||||
|
)
|
||||||
|
|
||||||
# define a new seed sequence for each run
|
# define a new seed sequence for each run
|
||||||
seed_sequence = numpy.random.SeedSequence(self.initial_seed)
|
seed_sequence = numpy.random.SeedSequence(self.initial_seed)
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
_logger.debug("Going to iterate over models now")
|
_logger.debug("Going to iterate over models now")
|
||||||
|
core_count = multiprocessing.cpu_count() - 1 or 1
|
||||||
|
if (self.cap_core_count >= 1) and (self.cap_core_count < core_count):
|
||||||
|
core_count = self.cap_core_count
|
||||||
|
_logger.info(f"Using {core_count} cores")
|
||||||
for model_count, (model, model_name) in enumerate(
|
for model_count, (model, model_name) in enumerate(
|
||||||
zip(self.models, self.model_names)
|
zip(self.models, self.model_names)
|
||||||
):
|
):
|
||||||
_logger.debug(f"Doing model #{model_count}: {model_name}")
|
_logger.debug(f"Doing model #{model_count}: {model_name}")
|
||||||
core_count = multiprocessing.cpu_count() - 1 or 1
|
|
||||||
with multiprocessing.Pool(core_count) as pool:
|
with multiprocessing.Pool(core_count) as pool:
|
||||||
cycle_count = 0
|
cycle_count = 0
|
||||||
cycle_success = 0
|
cycle_success = 0
|
||||||
@@ -162,27 +298,64 @@ class RealSpectrumRun:
|
|||||||
# that way we get more stuff.
|
# that way we get more stuff.
|
||||||
seeds = seed_sequence.spawn(self.monte_carlo_cycles)
|
seeds = seed_sequence.spawn(self.monte_carlo_cycles)
|
||||||
|
|
||||||
if self.use_fast_filter:
|
if self.use_pair_measurements:
|
||||||
result_func = get_a_result_fast_filter
|
current_success = sum(
|
||||||
else:
|
pool.imap_unordered(
|
||||||
result_func = get_a_result
|
get_a_result_fast_filter_pairs,
|
||||||
current_success = sum(
|
[
|
||||||
pool.imap_unordered(
|
(
|
||||||
result_func,
|
model,
|
||||||
[
|
self.dot_inputs_array,
|
||||||
(
|
lows,
|
||||||
model,
|
highs,
|
||||||
self.dot_inputs_array,
|
self.dot_pair_inputs_array,
|
||||||
lows,
|
pair_lows,
|
||||||
highs,
|
pair_highs,
|
||||||
self.monte_carlo_count,
|
self.monte_carlo_count,
|
||||||
seed,
|
seed,
|
||||||
)
|
)
|
||||||
for seed in seeds
|
for seed in seeds
|
||||||
],
|
],
|
||||||
self.chunksize,
|
self.chunksize,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif self.use_pair_phase_measurements:
|
||||||
|
current_success = sum(
|
||||||
|
pool.imap_unordered(
|
||||||
|
get_a_result_fast_filter_pairs,
|
||||||
|
[
|
||||||
|
(
|
||||||
|
model,
|
||||||
|
self.dot_pair_inputs_array,
|
||||||
|
pair_phase_lows,
|
||||||
|
pair_phase_highs,
|
||||||
|
self.monte_carlo_count,
|
||||||
|
seed,
|
||||||
|
)
|
||||||
|
for seed in seeds
|
||||||
|
],
|
||||||
|
self.chunksize,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
|
||||||
|
current_success = sum(
|
||||||
|
pool.imap_unordered(
|
||||||
|
get_a_result_fast_filter,
|
||||||
|
[
|
||||||
|
(
|
||||||
|
model,
|
||||||
|
self.dot_inputs_array,
|
||||||
|
lows,
|
||||||
|
highs,
|
||||||
|
self.monte_carlo_count,
|
||||||
|
seed,
|
||||||
|
)
|
||||||
|
for seed in seeds
|
||||||
|
],
|
||||||
|
self.chunksize,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
cycle_success += current_success
|
cycle_success += current_success
|
||||||
_logger.debug(f"current running successes: {cycle_success}")
|
_logger.debug(f"current running successes: {cycle_success}")
|
||||||
|
3
deepdog/subset_simulation/__init__.py
Normal file
3
deepdog/subset_simulation/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from deepdog.subset_simulation.subset_simulation_impl import SubsetSimulation
|
||||||
|
|
||||||
|
__all__ = ["SubsetSimulation"]
|
388
deepdog/subset_simulation/subset_simulation_impl.py
Normal file
388
deepdog/subset_simulation/subset_simulation_impl.py
Normal file
@@ -0,0 +1,388 @@
|
|||||||
|
import logging
|
||||||
|
import numpy
|
||||||
|
import pdme.measurement
|
||||||
|
import pdme.measurement.input_types
|
||||||
|
import pdme.subspace_simulation
|
||||||
|
from typing import Sequence, Tuple, Optional
|
||||||
|
|
||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class SubsetSimulationResult:
|
||||||
|
probs_list: Sequence[Tuple]
|
||||||
|
over_target_cost: Optional[float]
|
||||||
|
over_target_likelihood: Optional[float]
|
||||||
|
under_target_cost: Optional[float]
|
||||||
|
under_target_likelihood: Optional[float]
|
||||||
|
lowest_likelihood: Optional[float]
|
||||||
|
|
||||||
|
|
||||||
|
class SubsetSimulation:
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
model_name_pair,
|
||||||
|
dot_inputs,
|
||||||
|
actual_measurements: Sequence[pdme.measurement.DotMeasurement],
|
||||||
|
n_c: int,
|
||||||
|
n_s: int,
|
||||||
|
m_max: int,
|
||||||
|
target_cost: Optional[float] = None,
|
||||||
|
level_0_seed: int = 200,
|
||||||
|
mcmc_seed: int = 20,
|
||||||
|
use_adaptive_steps=True,
|
||||||
|
default_phi_step=0.01,
|
||||||
|
default_theta_step=0.01,
|
||||||
|
default_r_step=0.01,
|
||||||
|
default_w_log_step=0.01,
|
||||||
|
default_upper_w_log_step=4,
|
||||||
|
keep_probs_list=True,
|
||||||
|
dump_last_generation_to_file=False,
|
||||||
|
initial_cost_chunk_size=100,
|
||||||
|
):
|
||||||
|
name, model = model_name_pair
|
||||||
|
self.model_name = name
|
||||||
|
self.model = model
|
||||||
|
_logger.info(f"got model {self.model_name}")
|
||||||
|
|
||||||
|
self.dot_inputs_array = pdme.measurement.input_types.dot_inputs_to_array(
|
||||||
|
dot_inputs
|
||||||
|
)
|
||||||
|
# _logger.debug(f"actual measurements: {actual_measurements}")
|
||||||
|
self.actual_measurement_array = numpy.array([m.v for m in actual_measurements])
|
||||||
|
|
||||||
|
def cost_function_to_use(dipoles_to_test):
|
||||||
|
return pdme.subspace_simulation.proportional_costs_vs_actual_measurement(
|
||||||
|
self.dot_inputs_array, self.actual_measurement_array, dipoles_to_test
|
||||||
|
)
|
||||||
|
|
||||||
|
self.cost_function_to_use = cost_function_to_use
|
||||||
|
|
||||||
|
self.n_c = n_c
|
||||||
|
self.n_s = n_s
|
||||||
|
self.m_max = m_max
|
||||||
|
|
||||||
|
self.level_0_seed = level_0_seed
|
||||||
|
self.mcmc_seed = mcmc_seed
|
||||||
|
|
||||||
|
self.use_adaptive_steps = use_adaptive_steps
|
||||||
|
self.default_phi_step = default_phi_step
|
||||||
|
self.default_theta_step = default_theta_step
|
||||||
|
self.default_r_step = default_r_step
|
||||||
|
self.default_w_log_step = default_w_log_step
|
||||||
|
self.default_upper_w_log_step = default_upper_w_log_step
|
||||||
|
|
||||||
|
_logger.info("using params:")
|
||||||
|
_logger.info(f"\tn_c: {self.n_c}")
|
||||||
|
_logger.info(f"\tn_s: {self.n_s}")
|
||||||
|
_logger.info(f"\tm: {self.m_max}")
|
||||||
|
_logger.info("let's do level 0...")
|
||||||
|
|
||||||
|
self.target_cost = target_cost
|
||||||
|
_logger.info(f"will stop at target cost {target_cost}")
|
||||||
|
|
||||||
|
self.keep_probs_list = keep_probs_list
|
||||||
|
self.dump_last_generations = dump_last_generation_to_file
|
||||||
|
|
||||||
|
self.initial_cost_chunk_size = initial_cost_chunk_size
|
||||||
|
|
||||||
|
def execute(self) -> SubsetSimulationResult:
|
||||||
|
|
||||||
|
probs_list = []
|
||||||
|
|
||||||
|
sample_dipoles = self.model.get_monte_carlo_dipole_inputs(
|
||||||
|
self.n_c * self.n_s,
|
||||||
|
-1,
|
||||||
|
rng_to_use=numpy.random.default_rng(self.level_0_seed),
|
||||||
|
)
|
||||||
|
# _logger.debug(sample_dipoles)
|
||||||
|
# _logger.debug(sample_dipoles.shape)
|
||||||
|
|
||||||
|
raw_costs = []
|
||||||
|
_logger.debug(
|
||||||
|
f"Using iterated cost function thing with chunk size {self.initial_cost_chunk_size}"
|
||||||
|
)
|
||||||
|
|
||||||
|
for x in range(0, len(sample_dipoles), self.initial_cost_chunk_size):
|
||||||
|
_logger.debug(f"doing chunk {x}")
|
||||||
|
raw_costs.extend(
|
||||||
|
self.cost_function_to_use(
|
||||||
|
sample_dipoles[x : x + self.initial_cost_chunk_size]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
costs = numpy.array(raw_costs)
|
||||||
|
|
||||||
|
_logger.debug(f"costs: {costs}")
|
||||||
|
sorted_indexes = costs.argsort()[::-1]
|
||||||
|
|
||||||
|
_logger.debug(costs[sorted_indexes])
|
||||||
|
_logger.debug(sample_dipoles[sorted_indexes])
|
||||||
|
|
||||||
|
sorted_costs = costs[sorted_indexes]
|
||||||
|
sorted_dipoles = sample_dipoles[sorted_indexes]
|
||||||
|
|
||||||
|
threshold_cost = sorted_costs[-self.n_c]
|
||||||
|
|
||||||
|
all_dipoles = numpy.array(
|
||||||
|
[
|
||||||
|
pdme.subspace_simulation.sort_array_of_dipoles_by_frequency(samp)
|
||||||
|
for samp in sorted_dipoles
|
||||||
|
]
|
||||||
|
)
|
||||||
|
all_chains = list(zip(sorted_costs, all_dipoles))
|
||||||
|
|
||||||
|
mcmc_rng = numpy.random.default_rng(self.mcmc_seed)
|
||||||
|
|
||||||
|
for i in range(self.m_max):
|
||||||
|
next_seeds = all_chains[-self.n_c :]
|
||||||
|
|
||||||
|
if self.dump_last_generations:
|
||||||
|
_logger.info("writing out csv file")
|
||||||
|
next_dipoles_seed_dipoles = numpy.array([n[1] for n in next_seeds])
|
||||||
|
for n in range(self.model.n):
|
||||||
|
_logger.info(f"{next_dipoles_seed_dipoles[:, n].shape}")
|
||||||
|
numpy.savetxt(
|
||||||
|
f"generation_{self.n_c}_{self.n_s}_{i}_dipole_{n}.csv",
|
||||||
|
next_dipoles_seed_dipoles[:, n],
|
||||||
|
delimiter=",",
|
||||||
|
)
|
||||||
|
|
||||||
|
next_seeds_as_array = numpy.array([s for _, s in next_seeds])
|
||||||
|
stdevs = self.get_stdevs_from_arrays(next_seeds_as_array)
|
||||||
|
_logger.info(f"got stdevs: {stdevs.stdevs}")
|
||||||
|
all_long_chains = []
|
||||||
|
for seed_index, (c, s) in enumerate(
|
||||||
|
next_seeds[:: len(next_seeds) // 20]
|
||||||
|
):
|
||||||
|
# chain = mcmc(s, threshold_cost, n_s, model, dot_inputs_array, actual_measurement_array, mcmc_rng, curr_cost=c, stdevs=stdevs)
|
||||||
|
# until new version gotta do
|
||||||
|
_logger.debug(f"\t{seed_index}: doing long chain on the next seed")
|
||||||
|
|
||||||
|
long_chain = self.model.get_mcmc_chain(
|
||||||
|
s,
|
||||||
|
self.cost_function_to_use,
|
||||||
|
1000,
|
||||||
|
threshold_cost,
|
||||||
|
stdevs,
|
||||||
|
initial_cost=c,
|
||||||
|
rng_arg=mcmc_rng,
|
||||||
|
)
|
||||||
|
for _, chained in long_chain:
|
||||||
|
all_long_chains.append(chained)
|
||||||
|
all_long_chains_array = numpy.array(all_long_chains)
|
||||||
|
for n in range(self.model.n):
|
||||||
|
_logger.info(f"{all_long_chains_array[:, n].shape}")
|
||||||
|
numpy.savetxt(
|
||||||
|
f"long_chain_generation_{self.n_c}_{self.n_s}_{i}_dipole_{n}.csv",
|
||||||
|
all_long_chains_array[:, n],
|
||||||
|
delimiter=",",
|
||||||
|
)
|
||||||
|
|
||||||
|
if self.keep_probs_list:
|
||||||
|
for cost_index, cost_chain in enumerate(all_chains[: -self.n_c]):
|
||||||
|
probs_list.append(
|
||||||
|
(
|
||||||
|
((self.n_c * self.n_s - cost_index) / (self.n_c * self.n_s))
|
||||||
|
/ (self.n_s ** (i)),
|
||||||
|
cost_chain[0],
|
||||||
|
i + 1,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
next_seeds_as_array = numpy.array([s for _, s in next_seeds])
|
||||||
|
|
||||||
|
stdevs = self.get_stdevs_from_arrays(next_seeds_as_array)
|
||||||
|
_logger.info(f"got stdevs: {stdevs.stdevs}")
|
||||||
|
_logger.debug("Starting the MCMC")
|
||||||
|
all_chains = []
|
||||||
|
for seed_index, (c, s) in enumerate(next_seeds):
|
||||||
|
# chain = mcmc(s, threshold_cost, n_s, model, dot_inputs_array, actual_measurement_array, mcmc_rng, curr_cost=c, stdevs=stdevs)
|
||||||
|
# until new version gotta do
|
||||||
|
_logger.debug(
|
||||||
|
f"\t{seed_index}: getting another chain from the next seed"
|
||||||
|
)
|
||||||
|
chain = self.model.get_mcmc_chain(
|
||||||
|
s,
|
||||||
|
self.cost_function_to_use,
|
||||||
|
self.n_s,
|
||||||
|
threshold_cost,
|
||||||
|
stdevs,
|
||||||
|
initial_cost=c,
|
||||||
|
rng_arg=mcmc_rng,
|
||||||
|
)
|
||||||
|
for cost, chained in chain:
|
||||||
|
try:
|
||||||
|
filtered_cost = cost[0]
|
||||||
|
except (IndexError, TypeError):
|
||||||
|
filtered_cost = cost
|
||||||
|
all_chains.append((filtered_cost, chained))
|
||||||
|
_logger.debug("finished mcmc")
|
||||||
|
# _logger.debug(all_chains)
|
||||||
|
|
||||||
|
all_chains.sort(key=lambda c: c[0], reverse=True)
|
||||||
|
_logger.debug("finished sorting all_chains")
|
||||||
|
|
||||||
|
threshold_cost = all_chains[-self.n_c][0]
|
||||||
|
_logger.info(
|
||||||
|
f"current threshold cost: {threshold_cost}, at P = (1 / {self.n_s})^{i + 1}"
|
||||||
|
)
|
||||||
|
if (self.target_cost is not None) and (threshold_cost < self.target_cost):
|
||||||
|
_logger.info(
|
||||||
|
f"got a threshold cost {threshold_cost}, less than {self.target_cost}. will leave early"
|
||||||
|
)
|
||||||
|
|
||||||
|
cost_list = [c[0] for c in all_chains]
|
||||||
|
over_index = reverse_bisect_right(cost_list, self.target_cost)
|
||||||
|
|
||||||
|
shorter_probs_list = []
|
||||||
|
for cost_index, cost_chain in enumerate(all_chains):
|
||||||
|
if self.keep_probs_list:
|
||||||
|
probs_list.append(
|
||||||
|
(
|
||||||
|
(
|
||||||
|
(self.n_c * self.n_s - cost_index)
|
||||||
|
/ (self.n_c * self.n_s)
|
||||||
|
)
|
||||||
|
/ (self.n_s ** (i)),
|
||||||
|
cost_chain[0],
|
||||||
|
i + 1,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
shorter_probs_list.append(
|
||||||
|
(
|
||||||
|
cost_chain[0],
|
||||||
|
((self.n_c * self.n_s - cost_index) / (self.n_c * self.n_s))
|
||||||
|
/ (self.n_s ** (i)),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# _logger.info(shorter_probs_list)
|
||||||
|
result = SubsetSimulationResult(
|
||||||
|
probs_list=probs_list,
|
||||||
|
over_target_cost=shorter_probs_list[over_index - 1][0],
|
||||||
|
over_target_likelihood=shorter_probs_list[over_index - 1][1],
|
||||||
|
under_target_cost=shorter_probs_list[over_index][0],
|
||||||
|
under_target_likelihood=shorter_probs_list[over_index][1],
|
||||||
|
lowest_likelihood=shorter_probs_list[-1][1],
|
||||||
|
)
|
||||||
|
return result
|
||||||
|
|
||||||
|
# _logger.debug([c[0] for c in all_chains[-n_c:]])
|
||||||
|
_logger.info(f"doing level {i + 1}")
|
||||||
|
|
||||||
|
if self.keep_probs_list:
|
||||||
|
for cost_index, cost_chain in enumerate(all_chains):
|
||||||
|
probs_list.append(
|
||||||
|
(
|
||||||
|
((self.n_c * self.n_s - cost_index) / (self.n_c * self.n_s))
|
||||||
|
/ (self.n_s ** (self.m_max)),
|
||||||
|
cost_chain[0],
|
||||||
|
self.m_max + 1,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
threshold_cost = all_chains[-self.n_c][0]
|
||||||
|
_logger.info(
|
||||||
|
f"final threshold cost: {threshold_cost}, at P = (1 / {self.n_s})^{self.m_max + 1}"
|
||||||
|
)
|
||||||
|
for a in all_chains[-10:]:
|
||||||
|
_logger.info(a)
|
||||||
|
# for prob, prob_cost in probs_list:
|
||||||
|
# _logger.info(f"\t{prob}: {prob_cost}")
|
||||||
|
probs_list.sort(key=lambda c: c[0], reverse=True)
|
||||||
|
|
||||||
|
min_likelihood = ((1) / (self.n_c * self.n_s)) / (self.n_s ** (self.m_max))
|
||||||
|
|
||||||
|
result = SubsetSimulationResult(
|
||||||
|
probs_list=probs_list,
|
||||||
|
over_target_cost=None,
|
||||||
|
over_target_likelihood=None,
|
||||||
|
under_target_cost=None,
|
||||||
|
under_target_likelihood=None,
|
||||||
|
lowest_likelihood=min_likelihood,
|
||||||
|
)
|
||||||
|
return result
|
||||||
|
|
||||||
|
def get_stdevs_from_arrays(
|
||||||
|
self, array
|
||||||
|
) -> pdme.subspace_simulation.MCMCStandardDeviation:
|
||||||
|
# stdevs = get_stdevs_from_arrays(next_seeds_as_array, model)
|
||||||
|
if self.use_adaptive_steps:
|
||||||
|
|
||||||
|
stdev_array = []
|
||||||
|
count = array.shape[1]
|
||||||
|
for dipole_index in range(count):
|
||||||
|
selected = array[:, dipole_index]
|
||||||
|
pxs = selected[:, 0]
|
||||||
|
pys = selected[:, 1]
|
||||||
|
pzs = selected[:, 2]
|
||||||
|
thetas = numpy.arccos(pzs / self.model.pfixed)
|
||||||
|
phis = numpy.arctan2(pys, pxs)
|
||||||
|
|
||||||
|
rstdevs = numpy.maximum(
|
||||||
|
numpy.std(selected, axis=0)[3:6],
|
||||||
|
self.default_r_step / (self.n_s * 10),
|
||||||
|
)
|
||||||
|
frequency_stdevs = numpy.minimum(
|
||||||
|
numpy.maximum(
|
||||||
|
numpy.std(numpy.log(selected[:, -1])),
|
||||||
|
self.default_w_log_step / (self.n_s * 10),
|
||||||
|
),
|
||||||
|
self.default_upper_w_log_step,
|
||||||
|
)
|
||||||
|
stdev_array.append(
|
||||||
|
pdme.subspace_simulation.DipoleStandardDeviation(
|
||||||
|
p_theta_step=max(
|
||||||
|
numpy.std(thetas), self.default_theta_step / (self.n_s * 10)
|
||||||
|
),
|
||||||
|
p_phi_step=max(
|
||||||
|
numpy.std(phis), self.default_phi_step / (self.n_s * 10)
|
||||||
|
),
|
||||||
|
rx_step=rstdevs[0],
|
||||||
|
ry_step=rstdevs[1],
|
||||||
|
rz_step=rstdevs[2],
|
||||||
|
w_log_step=frequency_stdevs,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
default_stdev = pdme.subspace_simulation.DipoleStandardDeviation(
|
||||||
|
self.default_phi_step,
|
||||||
|
self.default_theta_step,
|
||||||
|
self.default_r_step,
|
||||||
|
self.default_r_step,
|
||||||
|
self.default_r_step,
|
||||||
|
self.default_w_log_step,
|
||||||
|
)
|
||||||
|
stdev_array = [default_stdev]
|
||||||
|
stdevs = pdme.subspace_simulation.MCMCStandardDeviation(stdev_array)
|
||||||
|
return stdevs
|
||||||
|
|
||||||
|
|
||||||
|
def reverse_bisect_right(a, x, lo=0, hi=None):
|
||||||
|
"""Return the index where to insert item x in list a, assuming a is sorted in descending order.
|
||||||
|
|
||||||
|
The return value i is such that all e in a[:i] have e >= x, and all e in
|
||||||
|
a[i:] have e < x. So if x already appears in the list, a.insert(x) will
|
||||||
|
insert just after the rightmost x already there.
|
||||||
|
|
||||||
|
Optional args lo (default 0) and hi (default len(a)) bound the
|
||||||
|
slice of a to be searched.
|
||||||
|
|
||||||
|
Essentially, the function returns number of elements in a which are >= than x.
|
||||||
|
>>> a = [8, 6, 5, 4, 2]
|
||||||
|
>>> reverse_bisect_right(a, 5)
|
||||||
|
3
|
||||||
|
>>> a[:reverse_bisect_right(a, 5)]
|
||||||
|
[8, 6, 5]
|
||||||
|
"""
|
||||||
|
if lo < 0:
|
||||||
|
raise ValueError("lo must be non-negative")
|
||||||
|
if hi is None:
|
||||||
|
hi = len(a)
|
||||||
|
while lo < hi:
|
||||||
|
mid = (lo + hi) // 2
|
||||||
|
if x > a[mid]:
|
||||||
|
hi = mid
|
||||||
|
else:
|
||||||
|
lo = mid + 1
|
||||||
|
return lo
|
@@ -40,8 +40,6 @@ def get_a_result_fast_filter(input) -> int:
|
|||||||
for temp in dot_inputs_dict.keys():
|
for temp in dot_inputs_dict.keys():
|
||||||
dot_inputs = dot_inputs_dict[temp]
|
dot_inputs = dot_inputs_dict[temp]
|
||||||
lows, highs = low_high_dict[temp]
|
lows, highs = low_high_dict[temp]
|
||||||
_logger.info(f"current sample length: {len(current_sample)}")
|
|
||||||
_logger.info(f"workng on temp {temp}")
|
|
||||||
for di, low, high in zip(dot_inputs, lows, highs):
|
for di, low, high in zip(dot_inputs, lows, highs):
|
||||||
|
|
||||||
if len(current_sample) < 1:
|
if len(current_sample) < 1:
|
||||||
@@ -92,6 +90,7 @@ class TempAwareRealSpectrumRun:
|
|||||||
max_monte_carlo_cycles_steps: int = 10,
|
max_monte_carlo_cycles_steps: int = 10,
|
||||||
chunksize: int = CHUNKSIZE,
|
chunksize: int = CHUNKSIZE,
|
||||||
initial_seed: int = 12345,
|
initial_seed: int = 12345,
|
||||||
|
cap_core_count: int = 0,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.measurements_dict = measurements_dict
|
self.measurements_dict = measurements_dict
|
||||||
self.dot_inputs_dict = {
|
self.dot_inputs_dict = {
|
||||||
@@ -128,6 +127,8 @@ class TempAwareRealSpectrumRun:
|
|||||||
self.filename = f"{timestamp}-{filename_slug}.realdata.{ff_string}.bayesrun.csv"
|
self.filename = f"{timestamp}-{filename_slug}.realdata.{ff_string}.bayesrun.csv"
|
||||||
self.initial_seed = initial_seed
|
self.initial_seed = initial_seed
|
||||||
|
|
||||||
|
self.cap_core_count = cap_core_count
|
||||||
|
|
||||||
def go(self) -> None:
|
def go(self) -> None:
|
||||||
with open(self.filename, "a", newline="") as outfile:
|
with open(self.filename, "a", newline="") as outfile:
|
||||||
writer = csv.DictWriter(outfile, fieldnames=self.csv_fields, dialect="unix")
|
writer = csv.DictWriter(outfile, fieldnames=self.csv_fields, dialect="unix")
|
||||||
@@ -148,11 +149,14 @@ class TempAwareRealSpectrumRun:
|
|||||||
|
|
||||||
results = []
|
results = []
|
||||||
_logger.debug("Going to iterate over models now")
|
_logger.debug("Going to iterate over models now")
|
||||||
|
core_count = multiprocessing.cpu_count() - 1 or 1
|
||||||
|
if (self.cap_core_count >= 1) and (self.cap_core_count < core_count):
|
||||||
|
core_count = self.cap_core_count
|
||||||
|
_logger.info(f"Using {core_count} cores")
|
||||||
for model_count, (model, model_name) in enumerate(
|
for model_count, (model, model_name) in enumerate(
|
||||||
zip(self.models, self.model_names)
|
zip(self.models, self.model_names)
|
||||||
):
|
):
|
||||||
_logger.debug(f"Doing model #{model_count}: {model_name}")
|
_logger.debug(f"Doing model #{model_count}: {model_name}")
|
||||||
core_count = multiprocessing.cpu_count() - 1 or 1
|
|
||||||
with multiprocessing.Pool(core_count) as pool:
|
with multiprocessing.Pool(core_count) as pool:
|
||||||
cycle_count = 0
|
cycle_count = 0
|
||||||
cycle_success = 0
|
cycle_success = 0
|
||||||
|
2
do.sh
2
do.sh
@@ -18,7 +18,7 @@ test() {
|
|||||||
|
|
||||||
fmt() {
|
fmt() {
|
||||||
poetry run black .
|
poetry run black .
|
||||||
find . -type f -name "*.py" -exec sed -i -e 's/ /\t/g' {} \;
|
find . -not \( -path "./.*" -type d -prune \) -type f -name "*.py" -exec sed -i -e 's/ /\t/g' {} \;
|
||||||
}
|
}
|
||||||
|
|
||||||
release() {
|
release() {
|
||||||
|
347
poetry.lock
generated
347
poetry.lock
generated
@@ -20,24 +20,9 @@ d = ["aiohttp (>=3.7.4)"]
|
|||||||
jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
|
jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
|
||||||
uvloop = ["uvloop (>=0.15.2)"]
|
uvloop = ["uvloop (>=0.15.2)"]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bleach"
|
|
||||||
version = "6.0.0"
|
|
||||||
description = "An easy safelist-based HTML-sanitizing tool."
|
|
||||||
category = "dev"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=3.7"
|
|
||||||
|
|
||||||
[package.dependencies]
|
|
||||||
six = ">=1.9.0"
|
|
||||||
webencodings = "*"
|
|
||||||
|
|
||||||
[package.extras]
|
|
||||||
css = ["tinycss2 (>=1.1.0,<1.2)"]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "certifi"
|
name = "certifi"
|
||||||
version = "2022.12.7"
|
version = "2024.2.2"
|
||||||
description = "Python package for providing Mozilla's CA Bundle."
|
description = "Python package for providing Mozilla's CA Bundle."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -45,18 +30,18 @@ python-versions = ">=3.6"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cffi"
|
name = "cffi"
|
||||||
version = "1.15.1"
|
version = "1.16.0"
|
||||||
description = "Foreign Function Interface for Python calling C code."
|
description = "Foreign Function Interface for Python calling C code."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
pycparser = "*"
|
pycparser = "*"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "charset-normalizer"
|
name = "charset-normalizer"
|
||||||
version = "3.1.0"
|
version = "3.3.2"
|
||||||
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
|
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -64,7 +49,7 @@ python-versions = ">=3.7.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "click"
|
name = "click"
|
||||||
version = "8.1.3"
|
version = "8.1.7"
|
||||||
description = "Composable command line interface toolkit"
|
description = "Composable command line interface toolkit"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -94,11 +79,11 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "coverage"
|
name = "coverage"
|
||||||
version = "7.2.3"
|
version = "7.4.3"
|
||||||
description = "Code coverage measurement for Python"
|
description = "Code coverage measurement for Python"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""}
|
tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""}
|
||||||
@@ -108,28 +93,28 @@ toml = ["tomli"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cryptography"
|
name = "cryptography"
|
||||||
version = "40.0.1"
|
version = "42.0.5"
|
||||||
description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
|
description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6"
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
cffi = ">=1.12"
|
cffi = {version = ">=1.12", markers = "platform_python_implementation != \"PyPy\""}
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"]
|
docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"]
|
||||||
docstest = ["pyenchant (>=1.6.11)", "twine (>=1.12.0)", "sphinxcontrib-spelling (>=4.0.1)"]
|
docstest = ["pyenchant (>=1.6.11)", "readme-renderer", "sphinxcontrib-spelling (>=4.0.1)"]
|
||||||
pep8test = ["black", "ruff", "mypy", "check-manifest"]
|
nox = ["nox"]
|
||||||
sdist = ["setuptools-rust (>=0.11.4)"]
|
pep8test = ["ruff", "mypy", "check-sdist", "click"]
|
||||||
|
sdist = ["build"]
|
||||||
ssh = ["bcrypt (>=3.1.5)"]
|
ssh = ["bcrypt (>=3.1.5)"]
|
||||||
test = ["pytest (>=6.2.0)", "pytest-shard (>=0.1.2)", "pytest-benchmark", "pytest-cov", "pytest-subtests", "pytest-xdist", "pretend", "iso8601"]
|
test = ["pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist", "pretend", "certifi"]
|
||||||
test-randomorder = ["pytest-randomly"]
|
test-randomorder = ["pytest-randomly"]
|
||||||
tox = ["tox"]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "docutils"
|
name = "docutils"
|
||||||
version = "0.19"
|
version = "0.20.1"
|
||||||
description = "Docutils -- Python Documentation Utilities"
|
description = "Docutils -- Python Documentation Utilities"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -145,7 +130,7 @@ python-versions = ">=3.5,<4.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "exceptiongroup"
|
name = "exceptiongroup"
|
||||||
version = "1.1.1"
|
version = "1.2.0"
|
||||||
description = "Backport of PEP 654 (exception groups)"
|
description = "Backport of PEP 654 (exception groups)"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -169,7 +154,7 @@ pyflakes = ">=2.4.0,<2.5.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gitdb"
|
name = "gitdb"
|
||||||
version = "4.0.10"
|
version = "4.0.11"
|
||||||
description = "Git Object Database"
|
description = "Git Object Database"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -180,7 +165,7 @@ smmap = ">=3.0.1,<6"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gitpython"
|
name = "gitpython"
|
||||||
version = "3.1.31"
|
version = "3.1.42"
|
||||||
description = "GitPython is a Python library used to interact with Git repositories"
|
description = "GitPython is a Python library used to interact with Git repositories"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -189,9 +174,12 @@ python-versions = ">=3.7"
|
|||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
gitdb = ">=4.0.1,<5"
|
gitdb = ">=4.0.1,<5"
|
||||||
|
|
||||||
|
[package.extras]
|
||||||
|
test = ["black", "coverage", "ddt (>=1.1.1,!=1.4.3)", "mypy", "pre-commit", "pytest (>=7.3.1)", "pytest-cov", "pytest-instafail", "pytest-mock", "pytest-sugar", "mock"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "idna"
|
name = "idna"
|
||||||
version = "3.4"
|
version = "3.6"
|
||||||
description = "Internationalized Domain Names in Applications (IDNA)"
|
description = "Internationalized Domain Names in Applications (IDNA)"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -199,34 +187,34 @@ python-versions = ">=3.5"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "importlib-metadata"
|
name = "importlib-metadata"
|
||||||
version = "6.2.1"
|
version = "7.0.1"
|
||||||
description = "Read metadata from Python packages"
|
description = "Read metadata from Python packages"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
zipp = ">=0.5"
|
zipp = ">=0.5"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"]
|
docs = ["sphinx (>=3.5)", "sphinx (<7.2.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"]
|
||||||
perf = ["ipython"]
|
perf = ["ipython"]
|
||||||
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "pytest-flake8", "importlib-resources (>=1.3)"]
|
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ruff", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "importlib-resources"
|
name = "importlib-resources"
|
||||||
version = "5.12.0"
|
version = "6.1.2"
|
||||||
description = "Read resources from Python packages"
|
description = "Read resources from Python packages"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""}
|
zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""}
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"]
|
docs = ["sphinx (>=3.5)", "sphinx (<7.2.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"]
|
||||||
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "pytest-flake8"]
|
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ruff (>=0.2.1)", "zipp (>=3.17)", "pytest-mypy"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iniconfig"
|
name = "iniconfig"
|
||||||
@@ -238,26 +226,26 @@ python-versions = ">=3.7"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "invoke"
|
name = "invoke"
|
||||||
version = "1.7.3"
|
version = "2.2.0"
|
||||||
description = "Pythonic task execution"
|
description = "Pythonic task execution"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = ">=3.6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jaraco.classes"
|
name = "jaraco.classes"
|
||||||
version = "3.2.3"
|
version = "3.3.1"
|
||||||
description = "Utility functions for Python class constructs"
|
description = "Utility functions for Python class constructs"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
more-itertools = "*"
|
more-itertools = "*"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "jaraco.tidelift (>=1.4)"]
|
docs = ["sphinx (>=3.5)", "sphinx (<7.2.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"]
|
||||||
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"]
|
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ruff (>=0.2.1)", "pytest-mypy"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jeepney"
|
name = "jeepney"
|
||||||
@@ -273,11 +261,11 @@ trio = ["trio", "async-generator"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "keyring"
|
name = "keyring"
|
||||||
version = "23.13.1"
|
version = "24.3.1"
|
||||||
description = "Store and access your passwords safely."
|
description = "Store and access your passwords safely."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
importlib-metadata = {version = ">=4.11.4", markers = "python_version < \"3.12\""}
|
importlib-metadata = {version = ">=4.11.4", markers = "python_version < \"3.12\""}
|
||||||
@@ -288,9 +276,9 @@ pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""}
|
|||||||
SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""}
|
SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""}
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
completion = ["shtab"]
|
completion = ["shtab (>=1.1.0)"]
|
||||||
docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "jaraco.tidelift (>=1.4)"]
|
docs = ["sphinx (>=3.5)", "sphinx (<7.2.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"]
|
||||||
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "pytest-flake8"]
|
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ruff (>=0.2.1)", "pytest-mypy"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mccabe"
|
name = "mccabe"
|
||||||
@@ -302,11 +290,11 @@ python-versions = "*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "more-itertools"
|
name = "more-itertools"
|
||||||
version = "9.1.0"
|
version = "10.2.0"
|
||||||
description = "More routines for operating on iterables, beyond itertools"
|
description = "More routines for operating on iterables, beyond itertools"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mypy"
|
name = "mypy"
|
||||||
@@ -334,6 +322,14 @@ category = "dev"
|
|||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.5"
|
python-versions = ">=3.5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nh3"
|
||||||
|
version = "0.2.15"
|
||||||
|
description = "Python bindings to the ammonia HTML sanitization library."
|
||||||
|
category = "dev"
|
||||||
|
optional = false
|
||||||
|
python-versions = "*"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "numpy"
|
name = "numpy"
|
||||||
version = "1.22.3"
|
version = "1.22.3"
|
||||||
@@ -344,7 +340,7 @@ python-versions = ">=3.8"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "packaging"
|
name = "packaging"
|
||||||
version = "23.0"
|
version = "23.2"
|
||||||
description = "Core utilities for Python packages"
|
description = "Core utilities for Python packages"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -352,19 +348,19 @@ python-versions = ">=3.7"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pathspec"
|
name = "pathspec"
|
||||||
version = "0.11.1"
|
version = "0.12.1"
|
||||||
description = "Utility library for gitignore style pattern matching of file paths."
|
description = "Utility library for gitignore style pattern matching of file paths."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pdme"
|
name = "pdme"
|
||||||
version = "0.8.8"
|
version = "0.9.3"
|
||||||
description = "Python dipole model evaluator"
|
description = "Python dipole model evaluator"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.8,<3.10"
|
python-versions = ">=3.8.1,<3.10"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
numpy = ">=1.22.3,<2.0.0"
|
numpy = ">=1.22.3,<2.0.0"
|
||||||
@@ -383,23 +379,23 @@ testing = ["pytest", "pytest-cov"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "platformdirs"
|
name = "platformdirs"
|
||||||
version = "3.2.0"
|
version = "4.2.0"
|
||||||
description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
|
description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)", "sphinx (>=6.1.3)"]
|
docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx-autodoc-typehints (>=1.25.2)", "sphinx (>=7.2.6)"]
|
||||||
test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest (>=7.2.2)"]
|
test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest (>=7.4.3)"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pluggy"
|
name = "pluggy"
|
||||||
version = "1.0.0"
|
version = "1.4.0"
|
||||||
description = "plugin and hook calling mechanisms for python"
|
description = "plugin and hook calling mechanisms for python"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
dev = ["pre-commit", "tox"]
|
dev = ["pre-commit", "tox"]
|
||||||
@@ -431,41 +427,42 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pygments"
|
name = "pygments"
|
||||||
version = "2.14.0"
|
version = "2.17.2"
|
||||||
description = "Pygments is a syntax highlighting package written in Python."
|
description = "Pygments is a syntax highlighting package written in Python."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6"
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
plugins = ["importlib-metadata"]
|
plugins = ["importlib-metadata"]
|
||||||
|
windows-terminal = ["colorama (>=0.4.6)"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pytest"
|
name = "pytest"
|
||||||
version = "7.3.0"
|
version = "8.0.2"
|
||||||
description = "pytest: simple powerful testing with Python"
|
description = "pytest: simple powerful testing with Python"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
||||||
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
|
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
|
||||||
iniconfig = "*"
|
iniconfig = "*"
|
||||||
packaging = "*"
|
packaging = "*"
|
||||||
pluggy = ">=0.12,<2.0"
|
pluggy = ">=1.3.0,<2.0"
|
||||||
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
|
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"]
|
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pytest-cov"
|
name = "pytest-cov"
|
||||||
version = "3.0.0"
|
version = "4.1.0"
|
||||||
description = "Pytest plugin for measuring coverage."
|
description = "Pytest plugin for measuring coverage."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6"
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
coverage = {version = ">=5.2.1", extras = ["toml"]}
|
coverage = {version = ">=5.2.1", extras = ["toml"]}
|
||||||
@@ -476,7 +473,7 @@ testing = ["fields", "hunter", "process-tests", "six", "pytest-xdist", "virtuale
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "python-gitlab"
|
name = "python-gitlab"
|
||||||
version = "3.13.0"
|
version = "3.15.0"
|
||||||
description = "Interact with GitLab API"
|
description = "Interact with GitLab API"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -492,7 +489,7 @@ yaml = ["PyYaml (>=5.2)"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "python-semantic-release"
|
name = "python-semantic-release"
|
||||||
version = "7.33.2"
|
version = "7.34.6"
|
||||||
description = "Automatic Semantic Versioning for Python projects"
|
description = "Automatic Semantic Versioning for Python projects"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -503,7 +500,7 @@ click = ">=7,<9"
|
|||||||
click-log = ">=0.3,<1"
|
click-log = ">=0.3,<1"
|
||||||
dotty-dict = ">=1.3.0,<2"
|
dotty-dict = ">=1.3.0,<2"
|
||||||
gitpython = ">=3.0.8,<4"
|
gitpython = ">=3.0.8,<4"
|
||||||
invoke = ">=1.4.1,<2"
|
invoke = ">=1.4.1,<3"
|
||||||
packaging = "*"
|
packaging = "*"
|
||||||
python-gitlab = ">=2,<4"
|
python-gitlab = ">=2,<4"
|
||||||
requests = ">=2.25,<3"
|
requests = ">=2.25,<3"
|
||||||
@@ -513,29 +510,29 @@ twine = ">=3,<4"
|
|||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
dev = ["tox", "isort", "black"]
|
dev = ["tox", "isort", "black"]
|
||||||
docs = ["Sphinx (==1.3.6)", "Jinja2 (==3.0.3)"]
|
docs = ["Sphinx (==1.8.6)", "Jinja2 (==3.0.3)"]
|
||||||
mypy = ["mypy", "types-requests"]
|
mypy = ["mypy", "types-requests"]
|
||||||
test = ["coverage (>=5,<6)", "pytest (>=7,<8)", "pytest-xdist (>=1,<2)", "pytest-mock (>=2,<3)", "responses (==0.13.3)", "mock (==1.3.0)"]
|
test = ["coverage (>=5,<6)", "pytest (>=7,<8)", "pytest-xdist (>=1,<2)", "pytest-mock (>=2,<3)", "responses (==0.13.3)", "mock (==1.3.0)"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pywin32-ctypes"
|
name = "pywin32-ctypes"
|
||||||
version = "0.2.0"
|
version = "0.2.2"
|
||||||
description = ""
|
description = "A (partial) reimplementation of pywin32 using ctypes/cffi"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = ">=3.6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "readme-renderer"
|
name = "readme-renderer"
|
||||||
version = "37.3"
|
version = "43.0"
|
||||||
description = "readme_renderer is a library for rendering \"readme\" descriptions for Warehouse"
|
description = "readme_renderer is a library for rendering readme descriptions for Warehouse"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
bleach = ">=2.1.0"
|
|
||||||
docutils = ">=0.13.1"
|
docutils = ">=0.13.1"
|
||||||
|
nh3 = ">=0.2.14"
|
||||||
Pygments = ">=2.5.1"
|
Pygments = ">=2.5.1"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
@@ -543,17 +540,17 @@ md = ["cmarkgfm (>=0.8.0)"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "requests"
|
name = "requests"
|
||||||
version = "2.28.2"
|
version = "2.31.0"
|
||||||
description = "Python HTTP for Humans."
|
description = "Python HTTP for Humans."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7, <4"
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
certifi = ">=2017.4.17"
|
certifi = ">=2017.4.17"
|
||||||
charset-normalizer = ">=2,<4"
|
charset-normalizer = ">=2,<4"
|
||||||
idna = ">=2.5,<4"
|
idna = ">=2.5,<4"
|
||||||
urllib3 = ">=1.21.1,<1.27"
|
urllib3 = ">=1.21.1,<3"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
|
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
|
||||||
@@ -561,7 +558,7 @@ use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "requests-toolbelt"
|
name = "requests-toolbelt"
|
||||||
version = "0.10.1"
|
version = "1.0.0"
|
||||||
description = "A utility belt for advanced users of python-requests"
|
description = "A utility belt for advanced users of python-requests"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -617,21 +614,24 @@ category = "dev"
|
|||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "six"
|
|
||||||
version = "1.16.0"
|
|
||||||
description = "Python 2 and 3 compatibility utilities"
|
|
||||||
category = "dev"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smmap"
|
name = "smmap"
|
||||||
version = "5.0.0"
|
version = "5.0.1"
|
||||||
description = "A pure Python implementation of a sliding window memory map manager"
|
description = "A pure Python implementation of a sliding window memory map manager"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6"
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syrupy"
|
||||||
|
version = "4.6.1"
|
||||||
|
description = "Pytest Snapshot Test Utility"
|
||||||
|
category = "dev"
|
||||||
|
optional = false
|
||||||
|
python-versions = ">=3.8.1,<4"
|
||||||
|
|
||||||
|
[package.dependencies]
|
||||||
|
pytest = ">=7.0.0,<9.0.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tomli"
|
name = "tomli"
|
||||||
@@ -643,7 +643,7 @@ python-versions = ">=3.7"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tomlkit"
|
name = "tomlkit"
|
||||||
version = "0.11.7"
|
version = "0.12.4"
|
||||||
description = "Style preserving TOML library"
|
description = "Style preserving TOML library"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -651,7 +651,7 @@ python-versions = ">=3.7"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tqdm"
|
name = "tqdm"
|
||||||
version = "4.65.0"
|
version = "4.66.2"
|
||||||
description = "Fast, Extensible Progress Meter"
|
description = "Fast, Extensible Progress Meter"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -661,7 +661,7 @@ python-versions = ">=3.7"
|
|||||||
colorama = {version = "*", markers = "platform_system == \"Windows\""}
|
colorama = {version = "*", markers = "platform_system == \"Windows\""}
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
dev = ["py-make (>=0.1.0)", "twine", "wheel"]
|
dev = ["pytest (>=6)", "pytest-cov", "pytest-timeout", "pytest-xdist"]
|
||||||
notebook = ["ipywidgets (>=6)"]
|
notebook = ["ipywidgets (>=6)"]
|
||||||
slack = ["slack-sdk"]
|
slack = ["slack-sdk"]
|
||||||
telegram = ["requests"]
|
telegram = ["requests"]
|
||||||
@@ -688,60 +688,49 @@ urllib3 = ">=1.26.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typing-extensions"
|
name = "typing-extensions"
|
||||||
version = "4.5.0"
|
version = "4.10.0"
|
||||||
description = "Backported and Experimental Type Hints for Python 3.7+"
|
description = "Backported and Experimental Type Hints for Python 3.8+"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "urllib3"
|
name = "urllib3"
|
||||||
version = "1.26.15"
|
version = "2.2.1"
|
||||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
brotli = ["brotlicffi (>=0.8.0)", "brotli (>=1.0.9)", "brotlipy (>=0.6.0)"]
|
brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
|
||||||
secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "urllib3-secure-extra", "ipaddress"]
|
h2 = ["h2 (>=4,<5)"]
|
||||||
socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
|
socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
|
||||||
|
zstd = ["zstandard (>=0.18.0)"]
|
||||||
[[package]]
|
|
||||||
name = "webencodings"
|
|
||||||
version = "0.5.1"
|
|
||||||
description = "Character encoding aliases for legacy web content"
|
|
||||||
category = "dev"
|
|
||||||
optional = false
|
|
||||||
python-versions = "*"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zipp"
|
name = "zipp"
|
||||||
version = "3.15.0"
|
version = "3.17.0"
|
||||||
description = "Backport of pathlib-compatible object wrapper for zip files"
|
description = "Backport of pathlib-compatible object wrapper for zip files"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"]
|
docs = ["sphinx (>=3.5)", "sphinx (<7.2.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"]
|
||||||
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "jaraco.itertools", "jaraco.functools", "more-itertools", "big-o", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "pytest-flake8"]
|
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ruff", "jaraco.itertools", "jaraco.functools", "more-itertools", "big-o", "pytest-ignore-flaky", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "1.1"
|
lock-version = "1.1"
|
||||||
python-versions = "^3.8,<3.10"
|
python-versions = ">=3.8.1,<3.10"
|
||||||
content-hash = "d32b74325a18dc187501980f37d128a2a07d7bb0e4ea2c5cb14cf14f8b7a0222"
|
content-hash = "b7f33da5b5a2af6bcb2a4c95cf391d04a76047d4f7e5c105b7cc38c73563fa51"
|
||||||
|
|
||||||
[metadata.files]
|
[metadata.files]
|
||||||
black = []
|
black = []
|
||||||
bleach = []
|
|
||||||
certifi = []
|
certifi = []
|
||||||
cffi = []
|
cffi = []
|
||||||
charset-normalizer = []
|
charset-normalizer = []
|
||||||
click = [
|
click = []
|
||||||
{file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"},
|
|
||||||
{file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"},
|
|
||||||
]
|
|
||||||
click-log = []
|
click-log = []
|
||||||
colorama = []
|
colorama = []
|
||||||
coverage = []
|
coverage = []
|
||||||
@@ -749,10 +738,7 @@ cryptography = []
|
|||||||
docutils = []
|
docutils = []
|
||||||
dotty-dict = []
|
dotty-dict = []
|
||||||
exceptiongroup = []
|
exceptiongroup = []
|
||||||
flake8 = [
|
flake8 = []
|
||||||
{file = "flake8-4.0.1-py2.py3-none-any.whl", hash = "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d"},
|
|
||||||
{file = "flake8-4.0.1.tar.gz", hash = "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d"},
|
|
||||||
]
|
|
||||||
gitdb = []
|
gitdb = []
|
||||||
gitpython = []
|
gitpython = []
|
||||||
idna = []
|
idna = []
|
||||||
@@ -763,103 +749,40 @@ invoke = []
|
|||||||
"jaraco.classes" = []
|
"jaraco.classes" = []
|
||||||
jeepney = []
|
jeepney = []
|
||||||
keyring = []
|
keyring = []
|
||||||
mccabe = [
|
mccabe = []
|
||||||
{file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"},
|
|
||||||
{file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"},
|
|
||||||
]
|
|
||||||
more-itertools = []
|
more-itertools = []
|
||||||
mypy = []
|
mypy = []
|
||||||
mypy-extensions = []
|
mypy-extensions = []
|
||||||
numpy = [
|
nh3 = []
|
||||||
{file = "numpy-1.22.3-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:92bfa69cfbdf7dfc3040978ad09a48091143cffb778ec3b03fa170c494118d75"},
|
numpy = []
|
||||||
{file = "numpy-1.22.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8251ed96f38b47b4295b1ae51631de7ffa8260b5b087808ef09a39a9d66c97ab"},
|
|
||||||
{file = "numpy-1.22.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:48a3aecd3b997bf452a2dedb11f4e79bc5bfd21a1d4cc760e703c31d57c84b3e"},
|
|
||||||
{file = "numpy-1.22.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a3bae1a2ed00e90b3ba5f7bd0a7c7999b55d609e0c54ceb2b076a25e345fa9f4"},
|
|
||||||
{file = "numpy-1.22.3-cp310-cp310-win32.whl", hash = "sha256:f950f8845b480cffe522913d35567e29dd381b0dc7e4ce6a4a9f9156417d2430"},
|
|
||||||
{file = "numpy-1.22.3-cp310-cp310-win_amd64.whl", hash = "sha256:08d9b008d0156c70dc392bb3ab3abb6e7a711383c3247b410b39962263576cd4"},
|
|
||||||
{file = "numpy-1.22.3-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:201b4d0552831f7250a08d3b38de0d989d6f6e4658b709a02a73c524ccc6ffce"},
|
|
||||||
{file = "numpy-1.22.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f8c1f39caad2c896bc0018f699882b345b2a63708008be29b1f355ebf6f933fe"},
|
|
||||||
{file = "numpy-1.22.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:568dfd16224abddafb1cbcce2ff14f522abe037268514dd7e42c6776a1c3f8e5"},
|
|
||||||
{file = "numpy-1.22.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ca688e1b9b95d80250bca34b11a05e389b1420d00e87a0d12dc45f131f704a1"},
|
|
||||||
{file = "numpy-1.22.3-cp38-cp38-win32.whl", hash = "sha256:e7927a589df200c5e23c57970bafbd0cd322459aa7b1ff73b7c2e84d6e3eae62"},
|
|
||||||
{file = "numpy-1.22.3-cp38-cp38-win_amd64.whl", hash = "sha256:07a8c89a04997625236c5ecb7afe35a02af3896c8aa01890a849913a2309c676"},
|
|
||||||
{file = "numpy-1.22.3-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:2c10a93606e0b4b95c9b04b77dc349b398fdfbda382d2a39ba5a822f669a0123"},
|
|
||||||
{file = "numpy-1.22.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fade0d4f4d292b6f39951b6836d7a3c7ef5b2347f3c420cd9820a1d90d794802"},
|
|
||||||
{file = "numpy-1.22.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bfb1bb598e8229c2d5d48db1860bcf4311337864ea3efdbe1171fb0c5da515d"},
|
|
||||||
{file = "numpy-1.22.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97098b95aa4e418529099c26558eeb8486e66bd1e53a6b606d684d0c3616b168"},
|
|
||||||
{file = "numpy-1.22.3-cp39-cp39-win32.whl", hash = "sha256:fdf3c08bce27132395d3c3ba1503cac12e17282358cb4bddc25cc46b0aca07aa"},
|
|
||||||
{file = "numpy-1.22.3-cp39-cp39-win_amd64.whl", hash = "sha256:639b54cdf6aa4f82fe37ebf70401bbb74b8508fddcf4797f9fe59615b8c5813a"},
|
|
||||||
{file = "numpy-1.22.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c34ea7e9d13a70bf2ab64a2532fe149a9aced424cd05a2c4ba662fd989e3e45f"},
|
|
||||||
{file = "numpy-1.22.3.zip", hash = "sha256:dbc7601a3b7472d559dc7b933b18b4b66f9aa7452c120e87dfb33d02008c8a18"},
|
|
||||||
]
|
|
||||||
packaging = []
|
packaging = []
|
||||||
pathspec = []
|
pathspec = []
|
||||||
pdme = []
|
pdme = []
|
||||||
pkginfo = []
|
pkginfo = []
|
||||||
platformdirs = []
|
platformdirs = []
|
||||||
pluggy = [
|
pluggy = []
|
||||||
{file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"},
|
pycodestyle = []
|
||||||
{file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"},
|
pycparser = []
|
||||||
]
|
pyflakes = []
|
||||||
pycodestyle = [
|
|
||||||
{file = "pycodestyle-2.8.0-py2.py3-none-any.whl", hash = "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20"},
|
|
||||||
{file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"},
|
|
||||||
]
|
|
||||||
pycparser = [
|
|
||||||
{file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"},
|
|
||||||
{file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"},
|
|
||||||
]
|
|
||||||
pyflakes = [
|
|
||||||
{file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"},
|
|
||||||
{file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"},
|
|
||||||
]
|
|
||||||
pygments = []
|
pygments = []
|
||||||
pytest = []
|
pytest = []
|
||||||
pytest-cov = [
|
pytest-cov = []
|
||||||
{file = "pytest-cov-3.0.0.tar.gz", hash = "sha256:e7f0f5b1617d2210a2cabc266dfe2f4c75a8d32fb89eafb7ad9d06f6d076d470"},
|
|
||||||
{file = "pytest_cov-3.0.0-py3-none-any.whl", hash = "sha256:578d5d15ac4a25e5f961c938b85a05b09fdaae9deef3bb6de9a6e766622ca7a6"},
|
|
||||||
]
|
|
||||||
python-gitlab = []
|
python-gitlab = []
|
||||||
python-semantic-release = []
|
python-semantic-release = []
|
||||||
pywin32-ctypes = [
|
pywin32-ctypes = []
|
||||||
{file = "pywin32-ctypes-0.2.0.tar.gz", hash = "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942"},
|
|
||||||
{file = "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", hash = "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"},
|
|
||||||
]
|
|
||||||
readme-renderer = []
|
readme-renderer = []
|
||||||
requests = []
|
requests = []
|
||||||
requests-toolbelt = []
|
requests-toolbelt = []
|
||||||
rfc3986 = [
|
rfc3986 = []
|
||||||
{file = "rfc3986-2.0.0-py2.py3-none-any.whl", hash = "sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd"},
|
|
||||||
{file = "rfc3986-2.0.0.tar.gz", hash = "sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c"},
|
|
||||||
]
|
|
||||||
scipy = []
|
scipy = []
|
||||||
secretstorage = []
|
secretstorage = []
|
||||||
semver = [
|
semver = []
|
||||||
{file = "semver-2.13.0-py2.py3-none-any.whl", hash = "sha256:ced8b23dceb22134307c1b8abfa523da14198793d9787ac838e70e29e77458d4"},
|
smmap = []
|
||||||
{file = "semver-2.13.0.tar.gz", hash = "sha256:fa0fe2722ee1c3f57eac478820c3a5ae2f624af8264cbdf9000c980ff7f75e3f"},
|
syrupy = []
|
||||||
]
|
tomli = []
|
||||||
six = [
|
|
||||||
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
|
|
||||||
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
|
|
||||||
]
|
|
||||||
smmap = [
|
|
||||||
{file = "smmap-5.0.0-py3-none-any.whl", hash = "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94"},
|
|
||||||
{file = "smmap-5.0.0.tar.gz", hash = "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"},
|
|
||||||
]
|
|
||||||
tomli = [
|
|
||||||
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
|
|
||||||
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
|
|
||||||
]
|
|
||||||
tomlkit = []
|
tomlkit = []
|
||||||
tqdm = []
|
tqdm = []
|
||||||
twine = [
|
twine = []
|
||||||
{file = "twine-3.8.0-py3-none-any.whl", hash = "sha256:d0550fca9dc19f3d5e8eadfce0c227294df0a2a951251a4385797c8a6198b7c8"},
|
|
||||||
{file = "twine-3.8.0.tar.gz", hash = "sha256:8efa52658e0ae770686a13b675569328f1fba9837e5de1867bfe5f46a9aefe19"},
|
|
||||||
]
|
|
||||||
typing-extensions = []
|
typing-extensions = []
|
||||||
urllib3 = []
|
urllib3 = []
|
||||||
webencodings = [
|
|
||||||
{file = "webencodings-0.5.1-py2.py3-none-any.whl", hash = "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78"},
|
|
||||||
{file = "webencodings-0.5.1.tar.gz", hash = "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"},
|
|
||||||
]
|
|
||||||
zipp = []
|
zipp = []
|
||||||
|
@@ -1,22 +1,23 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "deepdog"
|
name = "deepdog"
|
||||||
version = "0.6.5"
|
version = "0.7.7"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Deepak Mallubhotla <dmallubhotla+github@gmail.com>"]
|
authors = ["Deepak Mallubhotla <dmallubhotla+github@gmail.com>"]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8,<3.10"
|
python = ">=3.8.1,<3.10"
|
||||||
pdme = "^0.8.6"
|
pdme = "^0.9.3"
|
||||||
numpy = "1.22.3"
|
numpy = "1.22.3"
|
||||||
scipy = "1.10"
|
scipy = "1.10"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
pytest = ">=6"
|
pytest = ">=6"
|
||||||
flake8 = "^4.0.1"
|
flake8 = "^4.0.1"
|
||||||
pytest-cov = "^3.0.0"
|
pytest-cov = "^4.1.0"
|
||||||
mypy = "^0.971"
|
mypy = "^0.971"
|
||||||
python-semantic-release = "^7.24.0"
|
python-semantic-release = "^7.24.0"
|
||||||
black = "^22.3.0"
|
black = "^22.3.0"
|
||||||
|
syrupy = "^4.0.8"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0"]
|
||||||
|
177
tests/__snapshots__/test_bayes_run_with_ss.ambr
Normal file
177
tests/__snapshots__/test_bayes_run_with_ss.ambr
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
# serializer version: 1
|
||||||
|
# name: test_basic_analysis
|
||||||
|
list([
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 0.3333333333333333,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.3333333333333333,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.3333333333333333,
|
||||||
|
'dipole_frequency_1': 0.006029931414230269,
|
||||||
|
'dipole_frequency_2': 85436.78758379082,
|
||||||
|
'dipole_location_1': array([-4.76615152, -6.33160296, 5.29522808]),
|
||||||
|
'dipole_location_2': array([-4.72700391, -2.06478573, 6.52467702]),
|
||||||
|
'dipole_moment_1': array([ 860.14181416, -450.27082062, -239.60852996]),
|
||||||
|
'dipole_moment_2': array([ 908.18325588, -208.52681777, -362.93214244]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 0.45,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 0.3103448275862069,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.9,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.6206896551724138,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.06896551724137932,
|
||||||
|
'dipole_frequency_1': 102275.63477261562,
|
||||||
|
'dipole_frequency_2': 1755280.9783485082,
|
||||||
|
'dipole_location_1': array([ 4.71515397, -9.70362197, 5.43016546]),
|
||||||
|
'dipole_location_2': array([3.42476038, 3.88562934, 5.15034328]),
|
||||||
|
'dipole_moment_1': array([-502.60742674, -790.60222587, 349.7626267 ]),
|
||||||
|
'dipole_moment_2': array([-192.42708465, -434.81009148, -879.7226844 ]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 0.7,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 0.6631578947368421,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.18947368421052635,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.7,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.1473684210526316,
|
||||||
|
'dipole_frequency_1': 2896.799464036654,
|
||||||
|
'dipole_frequency_2': 9.980565189326681e-05,
|
||||||
|
'dipole_location_1': array([-4.97465789, 12.54716531, 6.06324588]),
|
||||||
|
'dipole_location_2': array([ 9.84518459, -11.1183876 , 7.35028226]),
|
||||||
|
'dipole_moment_1': array([997.67961917, 19.6376112 , 65.19004305]),
|
||||||
|
'dipole_moment_2': array([305.63093655, 440.57669389, 844.08643362]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 0.663157894736842,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.18947368421052635,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.1473684210526316,
|
||||||
|
'dipole_frequency_1': 1.4522667818288244,
|
||||||
|
'dipole_frequency_2': 2704.9795645301197,
|
||||||
|
'dipole_location_1': array([ 7.38183022, 16.6745801 , 7.10428414]),
|
||||||
|
'dipole_location_2': array([-8.15636906, -9.56609132, 6.34141559]),
|
||||||
|
'dipole_moment_1': array([-145.9924693 , 738.74936496, 657.97839986]),
|
||||||
|
'dipole_moment_2': array([-960.16113239, 104.96824669, -258.98314046]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 0.9,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 0.9465776293823038,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.030050083472454105,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.1,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.02337228714524208,
|
||||||
|
'dipole_frequency_1': 3827.2315421318913,
|
||||||
|
'dipole_frequency_2': 1.9301094166184413e-05,
|
||||||
|
'dipole_location_1': array([ 5.02067673, -0.9783039 , 6.1431897 ]),
|
||||||
|
'dipole_location_2': array([ 4.66628999, 10.80907459, 7.21771744]),
|
||||||
|
'dipole_moment_1': array([ 871.30659253, -299.17389491, -388.99846068]),
|
||||||
|
'dipole_moment_2': array([-189.87268624, 677.28285845, 710.79975568]),
|
||||||
|
}),
|
||||||
|
])
|
||||||
|
# ---
|
||||||
|
# name: test_bayesss_with_tighter_cost
|
||||||
|
list([
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 0.33333333333333337,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.33333333333333337,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.33333333333333337,
|
||||||
|
'dipole_frequency_1': 0.006029931414230269,
|
||||||
|
'dipole_frequency_2': 85436.78758379082,
|
||||||
|
'dipole_location_1': array([-4.76615152, -6.33160296, 5.29522808]),
|
||||||
|
'dipole_location_2': array([-4.72700391, -2.06478573, 6.52467702]),
|
||||||
|
'dipole_moment_1': array([ 860.14181416, -450.27082062, -239.60852996]),
|
||||||
|
'dipole_moment_2': array([ 908.18325588, -208.52681777, -362.93214244]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 0.0109375,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 0.1044776119402985,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.03125,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.2985074626865672,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.0625,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.5970149253731344,
|
||||||
|
'dipole_frequency_1': 102275.63477261562,
|
||||||
|
'dipole_frequency_2': 1755280.9783485082,
|
||||||
|
'dipole_location_1': array([ 4.71515397, -9.70362197, 5.43016546]),
|
||||||
|
'dipole_location_2': array([3.42476038, 3.88562934, 5.15034328]),
|
||||||
|
'dipole_moment_1': array([-502.60742674, -790.60222587, 349.7626267 ]),
|
||||||
|
'dipole_moment_2': array([-192.42708465, -434.81009148, -879.7226844 ]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 7.291135021404688e-05,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.021875,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.4666326413699001,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.0125,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.5332944472798858,
|
||||||
|
'dipole_frequency_1': 2896.799464036654,
|
||||||
|
'dipole_frequency_2': 9.980565189326681e-05,
|
||||||
|
'dipole_location_1': array([-4.97465789, 12.54716531, 6.06324588]),
|
||||||
|
'dipole_location_2': array([ 9.84518459, -11.1183876 , 7.35028226]),
|
||||||
|
'dipole_moment_1': array([997.67961917, 19.6376112 , 65.19004305]),
|
||||||
|
'dipole_moment_2': array([305.63093655, 440.57669389, 844.08643362]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 7.291135021404688e-05,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.4666326413699001,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.5332944472798858,
|
||||||
|
'dipole_frequency_1': 1.4522667818288244,
|
||||||
|
'dipole_frequency_2': 2704.9795645301197,
|
||||||
|
'dipole_location_1': array([ 7.38183022, 16.6745801 , 7.10428414]),
|
||||||
|
'dipole_location_2': array([-8.15636906, -9.56609132, 6.34141559]),
|
||||||
|
'dipole_moment_1': array([-145.9924693 , 738.74936496, 657.97839986]),
|
||||||
|
'dipole_moment_2': array([-960.16113239, 104.96824669, -258.98314046]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 0.175,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 0.00012008361740869356,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.05625,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.24702915581216964,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.15,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.7528507605704217,
|
||||||
|
'dipole_frequency_1': 3827.2315421318913,
|
||||||
|
'dipole_frequency_2': 1.9301094166184413e-05,
|
||||||
|
'dipole_location_1': array([ 5.02067673, -0.9783039 , 6.1431897 ]),
|
||||||
|
'dipole_location_2': array([ 4.66628999, 10.80907459, 7.21771744]),
|
||||||
|
'dipole_moment_1': array([ 871.30659253, -299.17389491, -388.99846068]),
|
||||||
|
'dipole_moment_2': array([-189.87268624, 677.28285845, 710.79975568]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 4.9116305003549454e-08,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 0.0109375,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.11316396672817797,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.028125,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.886835984155517,
|
||||||
|
'dipole_frequency_1': 1.1715179359592061e-05,
|
||||||
|
'dipole_frequency_2': 0.0019103783276337497,
|
||||||
|
'dipole_location_1': array([-0.95736547, 1.09273812, 7.47158641]),
|
||||||
|
'dipole_location_2': array([ -3.18510322, -15.64493131, 5.81623624]),
|
||||||
|
'dipole_moment_1': array([-184.64961369, 956.56786553, 225.57136075]),
|
||||||
|
'dipole_moment_2': array([ -34.63395137, 801.17771816, -597.42342885]),
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_fixedxy-pfixexp_3-dipole_count_2_prob': 1.977090156727901e-10,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_likelihood': 9.765625e-06,
|
||||||
|
'connors_geom-5height-orientation_fixedz-pfixexp_3-dipole_count_2_prob': 0.00045552157211010855,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_likelihood': 0.002734375,
|
||||||
|
'connors_geom-5height-orientation_free-pfixexp_3-dipole_count_2_prob': 0.9995444782301809,
|
||||||
|
'dipole_frequency_1': 999786.9069039805,
|
||||||
|
'dipole_frequency_2': 186034.67996840767,
|
||||||
|
'dipole_location_1': array([-5.59679125, 6.3411602 , 5.33602522]),
|
||||||
|
'dipole_location_2': array([-0.03412955, -6.83522954, 5.58551513]),
|
||||||
|
'dipole_moment_1': array([826.38270589, 491.81526944, 274.24325726]),
|
||||||
|
'dipole_moment_2': array([ 202.74745884, -656.07483714, -726.95204519]),
|
||||||
|
}),
|
||||||
|
])
|
||||||
|
# ---
|
158
tests/test_bayes_run_with_ss.py
Normal file
158
tests/test_bayes_run_with_ss.py
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
import deepdog
|
||||||
|
import logging
|
||||||
|
import logging.config
|
||||||
|
|
||||||
|
import numpy.random
|
||||||
|
|
||||||
|
from pdme.model import (
|
||||||
|
LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel,
|
||||||
|
LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel,
|
||||||
|
LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def fixed_z_model_func(
|
||||||
|
xmin,
|
||||||
|
xmax,
|
||||||
|
ymin,
|
||||||
|
ymax,
|
||||||
|
zmin,
|
||||||
|
zmax,
|
||||||
|
wexp_min,
|
||||||
|
wexp_max,
|
||||||
|
pfixed,
|
||||||
|
n_max,
|
||||||
|
prob_occupancy,
|
||||||
|
):
|
||||||
|
return LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel(
|
||||||
|
xmin,
|
||||||
|
xmax,
|
||||||
|
ymin,
|
||||||
|
ymax,
|
||||||
|
zmin,
|
||||||
|
zmax,
|
||||||
|
wexp_min,
|
||||||
|
wexp_max,
|
||||||
|
pfixed,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
n_max,
|
||||||
|
prob_occupancy,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def get_model(orientation):
|
||||||
|
model_funcs = {
|
||||||
|
"fixedz": fixed_z_model_func,
|
||||||
|
"free": LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel,
|
||||||
|
"fixedxy": LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel,
|
||||||
|
}
|
||||||
|
model = model_funcs[orientation](
|
||||||
|
-10,
|
||||||
|
10,
|
||||||
|
-17.5,
|
||||||
|
17.5,
|
||||||
|
5,
|
||||||
|
7.5,
|
||||||
|
-5,
|
||||||
|
6.5,
|
||||||
|
10**3,
|
||||||
|
2,
|
||||||
|
0.99999999,
|
||||||
|
)
|
||||||
|
model.n = 2
|
||||||
|
model.rng = numpy.random.default_rng(1234)
|
||||||
|
|
||||||
|
return (
|
||||||
|
f"connors_geom-5height-orientation_{orientation}-pfixexp_{3}-dipole_count_{2}",
|
||||||
|
model,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_basic_analysis(snapshot):
|
||||||
|
|
||||||
|
dot_positions = [[0, 0, 0], [0, 1, 0]]
|
||||||
|
|
||||||
|
freqs = [1, 10, 100]
|
||||||
|
models = []
|
||||||
|
|
||||||
|
orientations = ["free", "fixedxy", "fixedz"]
|
||||||
|
for orientation in orientations:
|
||||||
|
models.append(get_model(orientation))
|
||||||
|
|
||||||
|
_logger.info(f"have {len(models)} models to look at")
|
||||||
|
if len(models) == 1:
|
||||||
|
_logger.info(f"only one model, name: {models[0][0]}")
|
||||||
|
|
||||||
|
square_run = deepdog.BayesRunWithSubspaceSimulation(
|
||||||
|
dot_positions,
|
||||||
|
freqs,
|
||||||
|
models,
|
||||||
|
models[0][1],
|
||||||
|
filename_slug="test",
|
||||||
|
end_threshold=0.9,
|
||||||
|
ss_n_c=5,
|
||||||
|
ss_n_s=2,
|
||||||
|
ss_m_max=10,
|
||||||
|
ss_target_cost=150,
|
||||||
|
ss_level_0_seed=200,
|
||||||
|
ss_mcmc_seed=20,
|
||||||
|
ss_use_adaptive_steps=True,
|
||||||
|
ss_default_phi_step=0.01,
|
||||||
|
ss_default_theta_step=0.01,
|
||||||
|
ss_default_r_step=0.01,
|
||||||
|
ss_default_w_log_step=0.01,
|
||||||
|
ss_default_upper_w_log_step=4,
|
||||||
|
ss_dump_last_generation=False,
|
||||||
|
write_output_to_bayesruncsv=False,
|
||||||
|
ss_initial_costs_chunk_size=1000,
|
||||||
|
)
|
||||||
|
result = square_run.go()
|
||||||
|
|
||||||
|
assert result == snapshot
|
||||||
|
|
||||||
|
|
||||||
|
def test_bayesss_with_tighter_cost(snapshot):
|
||||||
|
|
||||||
|
dot_positions = [[0, 0, 0], [0, 1, 0]]
|
||||||
|
|
||||||
|
freqs = [1, 10, 100]
|
||||||
|
models = []
|
||||||
|
|
||||||
|
orientations = ["free", "fixedxy", "fixedz"]
|
||||||
|
for orientation in orientations:
|
||||||
|
models.append(get_model(orientation))
|
||||||
|
|
||||||
|
_logger.info(f"have {len(models)} models to look at")
|
||||||
|
if len(models) == 1:
|
||||||
|
_logger.info(f"only one model, name: {models[0][0]}")
|
||||||
|
|
||||||
|
square_run = deepdog.BayesRunWithSubspaceSimulation(
|
||||||
|
dot_positions,
|
||||||
|
freqs,
|
||||||
|
models,
|
||||||
|
models[0][1],
|
||||||
|
filename_slug="test",
|
||||||
|
end_threshold=0.9,
|
||||||
|
ss_n_c=5,
|
||||||
|
ss_n_s=2,
|
||||||
|
ss_m_max=10,
|
||||||
|
ss_target_cost=1.5,
|
||||||
|
ss_level_0_seed=200,
|
||||||
|
ss_mcmc_seed=20,
|
||||||
|
ss_use_adaptive_steps=True,
|
||||||
|
ss_default_phi_step=0.01,
|
||||||
|
ss_default_theta_step=0.01,
|
||||||
|
ss_default_r_step=0.01,
|
||||||
|
ss_default_w_log_step=0.01,
|
||||||
|
ss_default_upper_w_log_step=4,
|
||||||
|
ss_dump_last_generation=False,
|
||||||
|
write_output_to_bayesruncsv=False,
|
||||||
|
ss_initial_costs_chunk_size=1,
|
||||||
|
)
|
||||||
|
result = square_run.go()
|
||||||
|
|
||||||
|
assert result == snapshot
|
Reference in New Issue
Block a user