-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
When we load a mechanism with loadJson
music-box/src/acom_music_box/music_box.py
Lines 204 to 216 in 3b79d68
| self.solver = musica.MICM(config_path=camp_path, solver_type=musica.SolverType.rosenbrock_standard_order) | |
| elif "mechanism" in data and data["mechanism"]: | |
| # V1 mechanism configuration (in the same file) | |
| mechanism_json = data['mechanism'] | |
| with tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False) as tmp_mech_file: | |
| tmp_mech_file.write(json.dumps(mechanism_json)) | |
| tmp_mech_file.flush() | |
| tmp_mech_file_path = tmp_mech_file.name | |
| # Save mechanism | |
| parser = mc.Parser() | |
| self.__mechanism = parser.parse(tmp_mech_file_path) | |
| # Initalize the musica solver | |
| self.solver = musica.MICM(config_path=tmp_mech_file_path, solver_type=musica.SolverType.rosenbrock_standard_order) |
We directly assign to self.solver. If a solver already exists there, we may be leaking memory. Make sure that somehow those old solvers and their data get deleted
Acceptance criteria
- Make sure the
__del__option gets called on thesolver
Ideas
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels