Skip to content

Commit

Permalink
Fix bug in simulation parsing and saving
Browse files Browse the repository at this point in the history
  • Loading branch information
sivonxay committed Nov 7, 2023
1 parent 76ef519 commit 5b0f5e6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/NanoParticleTools/flows/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from NanoParticleTools.inputs import (SpectralKinetics, DopedNanoparticle,
NanoParticleConstraint)
from NanoParticleTools.species_data.species import Dopant
from NanoParticleTools.inputs.util import get_all_interactions
import sqlite3
import shutil
import logging
Expand Down Expand Up @@ -85,6 +84,13 @@ def npmc_job(constraints: Sequence[NanoParticleConstraint],
'np_db_path': os.path.join(output_dir, 'np.sqlite'),
'npmc_input': os.path.join(output_dir, 'npmc_input.json')
}
_initial_state_db_args = {

Check warning on line 87 in src/NanoParticleTools/flows/jobs.py

View check run for this annotation

Codecov / codecov/patch

src/NanoParticleTools/flows/jobs.py#L87

Added line #L87 was not covered by tests
'one_site_interaction_factor': 1,
'two_site_interaction_factor': 1,
'interaction_radius_bound': 3,
'distance_factor_type': 'inverse_cubic'
}
_initial_state_db_args.update(initial_state_db_args)

Check warning on line 93 in src/NanoParticleTools/flows/jobs.py

View check run for this annotation

Codecov / codecov/patch

src/NanoParticleTools/flows/jobs.py#L93

Added line #L93 was not covered by tests

# Check if output dir exists. If so, check if the input files match
fresh_start = False
Expand Down Expand Up @@ -176,14 +182,6 @@ def npmc_job(constraints: Sequence[NanoParticleConstraint],
initial_states)

# Write files
_initial_state_db_args = {
'one_site_interaction_factor': 1,
'two_site_interaction_factor': 1,
'interaction_radius_bound': 3,
'distance_factor_type': 'inverse_cubic'
}
_initial_state_db_args.update(initial_state_db_args)

if os.path.exists(output_dir):
# delete the directory, so we can start from scratch
shutil.rmtree(output_dir)
Expand Down

0 comments on commit 5b0f5e6

Please sign in to comment.