Skip to content

Commit

Permalink
merge integration to validation
Browse files Browse the repository at this point in the history
  • Loading branch information
b4pm-devops committed Dec 18, 2024
2 parents 6b6f802 + a341212 commit 6da333d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/source/how-to/wrap-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class GradientSellar(AbstractJacobianUnittest):
self.ee.prepare_execution()

# get the discipline where you want to check the gradients
disc = self.ee.root_process.proxy_disciplines[0].mdo_discipline_wrapp.mdo_discipline
disc = self.ee.root_process.proxy_disciplines[0].discipline_wrapp.mdo_discipline

# Check the jacobian using as reference the pre-computed jacobian. Note that, to force the re-computation
# and storage of the reference jacobian (upon model change), the environment variable DUMP_JACOBIAN_UNIT_TEST
Expand Down
6 changes: 3 additions & 3 deletions sostrades_core/execution_engine/proxy_discipline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1673,11 +1673,11 @@ def update_from_dm(self):

disc_in = self.get_data_in()
for var_name in disc_in:
var_f_name = self.get_var_full_name(var_name, disc_in)
try:
var_f_name = self.get_var_full_name(var_name, disc_in)
default_val = self.dm.data_dict[self.dm.get_data_id(var_f_name)][self.DEFAULT]
except:
var_f_name = self.get_var_full_name(var_name, disc_in)
except Exception:
default_val = None
if self.dm.get_value(var_f_name) is None and default_val is not None:
disc_in[var_name][self.VALUE] = default_val
else:
Expand Down
4 changes: 2 additions & 2 deletions sostrades_core/tools/check_process_gradients/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test(self):
result = True

self.override_dump_jacobian = True
disc_techno = self.ee.root_process.proxy_disciplines[0].mdo_discipline_wrapp.mdo_discipline
disc_techno = self.ee.root_process.proxy_disciplines[0].discipline_wrapp.mdo_discipline
pickle_filename = f'{test_name}.{model_name}'.replace('.', '_') + '.pkl'
if not os.path.exists(GENERATED_TEST_FOLDERNAME):
os.mkdir(GENERATED_TEST_FOLDERNAME)
Expand Down Expand Up @@ -289,7 +289,7 @@ def test_execute(self):
self.ee.execute()
disc_techno = self.ee.root_process.proxy_disciplines[0].mdo_discipline_wrapp.mdo_discipline
disc_techno = self.ee.root_process.proxy_disciplines[0].discipline_wrapp.mdo_discipline
self.check_jacobian(location=dirname(__file__), filename='{jacobian_pkl_name}',
discipline=disc_techno, step=1e-15, derr_approx='complex_step', local_data = disc_techno.local_data,
Expand Down

0 comments on commit 6da333d

Please sign in to comment.