Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major change in behaviour of settings #114

Merged
merged 49 commits into from
Mar 2, 2023
Merged

Major change in behaviour of settings #114

merged 49 commits into from
Mar 2, 2023

Conversation

n-claes
Copy link
Owner

@n-claes n-claes commented Jan 2, 2023

PR description

This is the first pull request in a series of refactoring and behaviour change PR's dedicated to Legolas 2.0.

Here a new settings object (called settings) is created to handle the global program settings and state. Most of the global variables have been removed from mod_global_variables except a few parameters and moved to this new object. Consequently, this also avoids changing global variables during runtime execution as in most routines the settings object is passes with intent(in) only. Dedicated getters and setters for set-once, use-only parameters further solidify this.

Note that this PR breaks the Legolas API in the user submodule. For example, enabling resistivity in the user submodule:

! before
resistivity = .true.
use_fixed_resistivity = .true.
fixed_eta_value = 0.0001d0

With the new changes, this becomes more logical and user-friendly:

! after
call settings%enable_resistivity(fixed_resistivity_value=0.0001d0)

with similar behaviour for other physics. See settings/mod_settings for the public API.

The datfile remains unchanged and is still backwards compatible. Some deprecated parfile settings have been removed, the docs will be updated accordingly when Legolas 2.0 is ready.

New features

Legolas

  • Removal of most global variables
  • Introduction of new settings object to control program settings and state
  • More logical default behaviour and settings control through the user submodule

@n-claes n-claes added legolas-backend Under-the-hood changes to Legolas refactor Refactoring existing code tests-unit Modified or new unit tests tests-regression Modified or new regression tests do NOT merge Don't merge until label is removed legolas-api Changes to the Legolas user API labels Jan 2, 2023
@n-claes n-claes added this to the Legolas 2.0 milestone Jan 2, 2023
@n-claes n-claes force-pushed the refactor/settings branch 3 times, most recently from 2ace63f to 1de3c81 Compare January 2, 2023 13:48
@codecov
Copy link

codecov bot commented Jan 2, 2023

Codecov Report

Merging #114 (03d273d) into develop (a85c5a8) will increase coverage by 0.44%.
The diff coverage is 92.38%.

❗ Current head 03d273d differs from pull request most recent head 0977beb. Consider uploading reports for the commit 0977beb to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #114      +/-   ##
===========================================
+ Coverage    88.94%   89.39%   +0.44%     
===========================================
  Files          129      143      +14     
  Lines         7516     8098     +582     
===========================================
+ Hits          6685     7239     +554     
- Misses         831      859      +28     
Flag Coverage Δ
legolas 90.40% <92.38%> (+0.01%) ⬆️
pylbo 87.46% <ø> (+0.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@n-claes n-claes force-pushed the refactor/settings branch from 03d273d to 0977beb Compare March 2, 2023 09:53
@n-claes n-claes removed the do NOT merge Don't merge until label is removed label Mar 2, 2023
@n-claes n-claes merged commit dd55ca9 into develop Mar 2, 2023
@n-claes n-claes deleted the refactor/settings branch March 2, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legolas-api Changes to the Legolas user API legolas-backend Under-the-hood changes to Legolas refactor Refactoring existing code tests-regression Modified or new regression tests tests-unit Modified or new unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant