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

Feature/experimental validation tests #471

Merged
merged 13 commits into from Jan 17, 2024

Conversation

mgovers
Copy link
Member

@mgovers mgovers commented Jan 17, 2024

Add experimental features option for validation tests that are not yet finalized

The usage is as follows:

  • the extra_params dict contains an update to the params.json which may overload certain parameters for a specific calculation type. E.g.:
  • the fail expected failure feature is extended
    • made into a dict
    • Python
      • made mandatory (i.e.: it should be removed if the expected failure is ever fixed)
      • now also supports exceptions other than AssertionError
    • C++
      • remains [skipped] (unchanged)
      • all cases marked fail are now skipped (not only "fail": true)
  • the experimental_features parameter may be set to enabled or disabled to enable experimental features from the Python API

params.json

Expected failures

No issue

{
  "calculation_method": ["newton_raphson", "iterative_current"],
  "rtol": 1e-5,
  "atol": 1e-5
}

Global specification

All cases should result in expected fail (xfail)

{
  "calculation_method": ["newton_raphson", "iterative_current"],
  "rtol": 1e-5,
  "atol": 1e-5,
  "fail": {
    "reason": "Experimental feature under development",
    "raises": "PowerGridError"  // may be omitted for AssertionError
  }
}

Extra params: expected fail

Only iterative_current results in expected fail (xfail)

  "calculation_method": ["newton_raphson", "iterative_current"],
  "rtol": 1e-5,
  "atol": 1e-5,
  "extra_params": {
    "iterative_current": {
      "fail": {
        "reason": "Experimental feature under development",
        "raises": "PowerGridError"  // may be omitted for AssertionError
      }
    }
  }
}

Both specified

All calculation_methods should result in expected fail (xfail)

{
  "calculation_method": ["newton_raphson", "iterative_current"],
  "rtol": 1e-5,
  "atol": 1e-5,
  "fail": "failure reson"
  "extra_params": {
    "iterative_current": {
      "fail": {
        "reason": "Experimental feature under development",
        "raises": "PowerGridError"  // may be omitted for AssertionError
      }
    }
  }
}

experimental features

For all calculation_methods

{
  "calculation_method": ["newton_raphson", "iterative_current"],
  "rtol": 1e-5,
  "atol": 1e-5,
  "experimental_features": "enabled"
}

As calculation_method-specific parameter

{
  "calculation_method": ["iterative_linear", "newton_raphson"],
  "rtol": 1e-6,
  "atol": {
    "q.*": 1e-1,
    "default": 1e-6
  },
  "extra_params": {
    "newton_raphson": {
      "experimental_features": "enabled"
    }
  }
}

All specified

{
  "calculation_method": ["iterative_linear", "newton_raphson"],
  "rtol": 1e-6,
  "atol": {
    "q.*": 1e-1,
    "default": 1e-6
  },
  "extra_params": {
    "newton_raphson": {
      "experimental_features": "enabled",
      "fail": {
        "reason": "Experimental feature under development",
        "raises": "PowerGridError"
      }
    }
  }
}

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
@mgovers mgovers added the feature New feature or request label Jan 17, 2024
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
@mgovers mgovers self-assigned this Jan 17, 2024
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
@mgovers mgovers marked this pull request as ready for review January 17, 2024 11:29
@mgovers
Copy link
Member Author

mgovers commented Jan 17, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues 0 Security Hotspots 89.3% Coverage on New Code 0.0% Duplication on New Code

See analysis details on SonarCloud

newly introduced sonar cloud issues are not issues but actual API design choices consistent with existing code base

@mgovers mgovers mentioned this pull request Jan 17, 2024
Copy link
Member

@TonyXiang8787 TonyXiang8787 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One change needed in the C API docstring.

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
…ff-main

enable running newton raphson for state estimation tests
Copy link

sonarcloud bot commented Jan 17, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
89.3% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@mgovers mgovers merged commit 0071184 into main Jan 17, 2024
26 checks passed
@mgovers mgovers deleted the feature/experimental-validation-tests branch January 17, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants