TST: Add export test for TradLife_A_EX1 risk margin#239
Merged
Conversation
Compare Projection[i].risk_margin(0) for i=0 and 299 between the modelx model and its exported counterpart. The model reads input.xlsx from its parent directory at run time, so the workbook is copied next to the exported model as well. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Exporting into the same directory as the source model lets the exported model find input.xlsx in its parent directory, removing the need to copy the workbook separately. A bundled copy of the exported model, if any, is removed before exporting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
test_annuallifetomodelx/tests/export/test_lifelib.py, testing the exported (nomx) model of lifelib'sannuallife/TradLife_A_EX1against the source modelx model. The test asserts thatProjection[i].risk_margin(0)agrees between the two for model pointsi = 0andi = 299.Why
TradLife_A_EX1exercises nested projections (InnerProjItemSpaces under prescribed life stresses at each projection step), which were not previously covered by the export tests.Notes for review
input.xlsxfrom its parent directory at run time (_model.path.parent / input_file_name), and the exporter does not bake the workbook in. The test therefore exports the nomx model into the same directory as the source model, so both resolve the same workbook.TradLife_A_EX1_nomxdirectory bundled with the copied library, if present, is removed before exporting, since the exporter overwrites files but does not clear a pre-existing target directory.annuallifelibrary.🤖 Generated with Claude Code