Compare commits
4 Commits
23611215d7
...
f9de0b4e75
Author | SHA1 | Date | |
---|---|---|---|
f9de0b4e75 | |||
c2375e6f5c | |||
a1b59cd18b | |||
53f8993f2b |
@ -2,6 +2,14 @@
|
||||
|
||||
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.
|
||||
|
||||
## [1.5.0](https://gitea.deepak.science:2222/physics/deepdog/compare/1.4.0...1.5.0) (2024-12-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add configurable max number of dipoles to write ([a1b59cd](https://gitea.deepak.science:2222/physics/deepdog/commit/a1b59cd18b30359328a09210d9393f211aab30c2))
|
||||
* add configurable max number of dipoles to write ([53f8993](https://gitea.deepak.science:2222/physics/deepdog/commit/53f8993f2b155228fff5cbee84f10c62eb149a1f))
|
||||
|
||||
## [1.4.0](https://gitea.deepak.science:2222/physics/deepdog/compare/1.3.0...1.4.0) (2024-09-04)
|
||||
|
||||
|
||||
|
@ -284,31 +284,47 @@ class DirectMonteCarloRun:
|
||||
|
||||
pool_results = sum(result[0] for result in raw_pool_results)
|
||||
|
||||
_logger.debug(f"Pool results: {pool_results}")
|
||||
|
||||
if self.config.write_successes_to_file:
|
||||
|
||||
_logger.info("Writing dipole results")
|
||||
|
||||
cycle_success_configs = numpy.concatenate(
|
||||
[result[1] for result in raw_pool_results]
|
||||
)
|
||||
if len(cycle_success_configs):
|
||||
|
||||
dipole_count = numpy.array(cycle_success_configs).shape[1]
|
||||
|
||||
max_number_dipoles_to_write = self.config.target_success * 5
|
||||
_logger.debug(
|
||||
f"Limiting to {max_number_dipoles_to_write=}, have {len(cycle_success_configs)}"
|
||||
)
|
||||
|
||||
if len(cycle_success_configs):
|
||||
sorted_by_freq = numpy.array(
|
||||
[
|
||||
pdme.subspace_simulation.sort_array_of_dipoles_by_frequency(
|
||||
dipole_config
|
||||
)
|
||||
for dipole_config in cycle_success_configs
|
||||
for dipole_config in cycle_success_configs[
|
||||
:max_number_dipoles_to_write
|
||||
]
|
||||
]
|
||||
)
|
||||
dipole_count = numpy.array(cycle_success_configs).shape[1]
|
||||
|
||||
number_dipoles_to_write = self.config.target_success * 5
|
||||
_logger.info(
|
||||
f"Limiting to {number_dipoles_to_write=}, have {dipole_count}"
|
||||
)
|
||||
|
||||
for n in range(dipole_count):
|
||||
|
||||
dipole_filename = (
|
||||
f"{self.config.tag}_{step_count}_dipole_{n}.csv"
|
||||
)
|
||||
_logger.debug(
|
||||
f"Writing {min(len(cycle_success_configs), max_number_dipoles_to_write)} to {dipole_filename}"
|
||||
)
|
||||
|
||||
numpy.savetxt(
|
||||
f"{self.config.tag}_{step_count}_dipole_{n}.csv",
|
||||
sorted_by_freq[::number_dipoles_to_write, n],
|
||||
dipole_filename,
|
||||
sorted_by_freq[:, n],
|
||||
delimiter=",",
|
||||
)
|
||||
else:
|
||||
@ -316,8 +332,6 @@ class DirectMonteCarloRun:
|
||||
"Instructed to write results, but none obtained"
|
||||
)
|
||||
|
||||
_logger.debug(f"Pool results: {pool_results}")
|
||||
|
||||
total_success += pool_results
|
||||
total_count += count_per_step
|
||||
_logger.debug(
|
||||
|
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "deepdog"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
description = ""
|
||||
authors = ["Deepak Mallubhotla <dmallubhotla+github@gmail.com>"]
|
||||
|
||||
@ -15,7 +15,7 @@ tqdm = "^4.66.2"
|
||||
pytest = ">=6"
|
||||
flake8 = "^4.0.1"
|
||||
pytest-cov = "^4.1.0"
|
||||
mypy = "^0.971"
|
||||
mypy = "^1.15"
|
||||
python-semantic-release = "^7.24.0"
|
||||
black = "^22.3.0"
|
||||
syrupy = "^4.0.8"
|
||||
|
Loading…
x
Reference in New Issue
Block a user