Skip to content

Conversation

dayantur
Copy link

@dayantur dayantur commented Oct 1, 2025

This PR addresses issue #707 by proposing a logic in the validator that selects a specific sample config (with a specific structure) based on nlayer value.

This PR is also directly related to PR #690 and should be merged after that.

Main changes

  • Edited validate_config.py to detect nlayer from user YAML to select appropriate sample config
  • Added detect_nlayer_from_user_yaml to orchestrator.py
  • Edited phase_a_parameter_update.py and phase_b_science_check.py accordingly
  • Added sample_config_1.yml and sample_config_3.yml to meson.build

Further implementations

  • Added n=2,4,5,6 cases
  • Added comprehensive tests

Future implementations
A more elegant feature that implements a rule/logic to check yaml structure based on user nlayer value and independently from sample_config standard will be addressed in a separate PR.

@dayantur dayantur temporarily deployed to github-pages-preview October 1, 2025 13:41 — with GitHub Actions Inactive
Copy link

github-actions bot commented Oct 1, 2025

🔍 Schema Preview Deployed

Preview URLs:

Production URLs (unchanged):


⚠️ Important: Preview schemas are in a subdirectory and do not affect production. The preview pages include warning banners to prevent accidental use in production configs.

Copy link

github-actions bot commented Oct 1, 2025

🤖 I've automatically formatted the code in this PR using:

  • Python: ruff v0.8.6
  • Fortran: fprettify v0.3.7

Please pull the latest changes before making further edits.

@dayantur dayantur temporarily deployed to github-pages-preview October 1, 2025 20:24 — with GitHub Actions Inactive
@dayantur dayantur self-assigned this Oct 14, 2025
@dayantur dayantur temporarily deployed to github-pages-preview October 14, 2025 08:47 — with GitHub Actions Inactive
@dayantur dayantur temporarily deployed to github-pages-preview October 14, 2025 09:25 — with GitHub Actions Inactive
Copy link

🤖 I've automatically formatted the code in this PR using:

  • Python: ruff v0.8.6
  • Fortran: fprettify v0.3.7

Please pull the latest changes before making further edits.

@dayantur dayantur temporarily deployed to github-pages-preview October 14, 2025 10:02 — with GitHub Actions Inactive
Copy link

🤖 I've automatically formatted the code in this PR using:

  • Python: ruff v0.8.6
  • Fortran: fprettify v0.3.7

Please pull the latest changes before making further edits.

@dayantur dayantur requested a review from sunt05 October 14, 2025 10:15
@dayantur dayantur marked this pull request as ready for review October 14, 2025 10:15
@sunt05
Copy link

sunt05 commented Oct 14, 2025

Thanks @dayantur - but isn't #707 already addressed?
Please clarify what this PR is for.

@dayantur
Copy link
Author

hi @sunt05 :)

At the moment, all user configs are validated against sample_config.yml, which has nlayer==3.

When user has nlayer≠3:
- nlayer > 3 (e.g., 5 layers): Phase A can't check elements [4] and [5] because the standard only has 3 elements →
incomplete validation
- nlayer < 3 (e.g., 1 layer): Phase A tries to compare against 3 elements, so it adds dummy values for missing
elements [2] and [3] → pollutes user config with fake data

This PR addresses a practical but not yet very elegant solution proposing to:

  • Detect nlayer from user config
  • Select matching sample_config_{nlayer}.yml (1-7)
  • Then validate expected structure: nlayer=5 config → sample_config_5.yml

@sunt05 sunt05 marked this pull request as draft October 14, 2025 10:50
@sunt05
Copy link

sunt05 commented Oct 14, 2025

I understand your point, but we need a cleaner solution. We shouldn't keep adding sample files to address this. Let's consider another plan.

@dayantur
Copy link
Author

I understand your point, but we need a cleaner solution. We shouldn't keep adding sample files to address this. Let's consider another plan.

I agree with you :( This strategy does not work well in the long term.

One idea could be to add rules to phase A associated with nlayer number.
If nlayer is equal to n, then we have some constraints for specific parameters (i.e. array dimensions equal to n or n+1, roofs and walls substructures repeated n times, etc.)

@dayantur
Copy link
Author

I understand your point, but we need a cleaner solution. We shouldn't keep adding sample files to address this. Let's consider another plan.

I agree with you :( This strategy does not work well in the long term.

One idea could be to add rules to phase A associated with nlayer number. If nlayer is equal to n, then we have some constraints for specific parameters (i.e. array dimensions equal to n or n+1, roofs and walls substructures repeated n times, etc.)

Hi @sunt05 :) I am succesfully implementing the idea above in draft PR #731 . I will let you know there once ready for a review :)

@sunt05
Copy link

sunt05 commented Oct 17, 2025

Hello @dayantur - it looks like this has been dealt with in #731? if so, shall we close this one?

@dayantur
Copy link
Author

this has ben resolved in #731

@dayantur dayantur closed this Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants