feat: add configurable max number of dipoles to write
All checks were successful
gitea-physics/deepdog/pipeline/head This commit looks good
All checks were successful
gitea-physics/deepdog/pipeline/head This commit looks good
This commit is contained in:
@@ -301,22 +301,26 @@ class DirectMonteCarloRun:
|
|||||||
f"Limiting to {max_number_dipoles_to_write=}, have {len(cycle_success_configs)}"
|
f"Limiting to {max_number_dipoles_to_write=}, have {len(cycle_success_configs)}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if len(cycle_success_configs):
|
if len(cycle_success_configs):
|
||||||
sorted_by_freq = numpy.array(
|
sorted_by_freq = numpy.array(
|
||||||
[
|
[
|
||||||
pdme.subspace_simulation.sort_array_of_dipoles_by_frequency(
|
pdme.subspace_simulation.sort_array_of_dipoles_by_frequency(
|
||||||
dipole_config
|
dipole_config
|
||||||
)
|
)
|
||||||
for dipole_config in cycle_success_configs[:max_number_dipoles_to_write]
|
for dipole_config in cycle_success_configs[
|
||||||
|
:max_number_dipoles_to_write
|
||||||
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
for n in range(dipole_count):
|
for n in range(dipole_count):
|
||||||
|
|
||||||
dipole_filename = f"{self.config.tag}_{step_count}_dipole_{n}.csv"
|
dipole_filename = (
|
||||||
_logger.debug(f"Writing {min(len(cycle_success_configs), max_number_dipoles_to_write)} to {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(
|
numpy.savetxt(
|
||||||
dipole_filename,
|
dipole_filename,
|
||||||
|
Reference in New Issue
Block a user