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

Fix/#315 deviating stats #324

Merged
merged 24 commits into from May 10, 2021
Merged

Fix/#315 deviating stats #324

merged 24 commits into from May 10, 2021

Conversation

gplssm
Copy link
Contributor

@gplssm gplssm commented Jan 29, 2020

Fix #315

Actually, it's not really fixed. Clearly spoken, we ship around the issue of non-deterministic results with ding0 when using Python>=3.5 by just allowing Python version >=3.6.
The problematic piece of code was not found in the end. It's quite likely that the solution is related to the following change:

Money quote from Python 3.6 what's new

[...] The order-preserving aspect of this new implementation is considered an implementation detail and should not be relied upon (this may change in the future, but it is desired to have this new dict implementation in the language for a few releases before changing the language spec to mandate order-preserving semantics for all current and future Python implementations; this also helps preserve backwards-compatibility with older versions of the language where random iteration order is still in effect, e.g. Python 3.5). [...]

Because Pandas 0.20.3 isn't available with Python >=3.7, currently, only Python 3.6 is supported.

Furthermore, it introduces

  • A test that guarantees consitency of results for a real example
  • A step-wise test through run_ding0 covering all testable steps
  • A conftest.py for pytest that allows for example to provide package-wide fixtures
  • A unique representative for LVLoadDing0
  • Make all tests run again

While implementing the fix for #315, it also closes #314.

As a result and in order to clean up, I would suggest to

Guido Pleßmann added 23 commits October 2, 2019 17:24
oedb_session fixtures was moved to conftest.py which is accessible by
all tests
This test class verifies results for each step of run_ding0().
* tests/core/network/test_network.py::TestGridDing0::test_grid_stats
* tests/tools/test_results.py::TestCalculateStats
* Updated expected data
* Expected edges hard-coded as strings now
* Simplified comparison and asserts (element-wise)
* Asserts all 30 edges are compared (inkluding cable distributors)
* Still preserves order of edges
@gplssm gplssm requested a review from AnyaHe January 29, 2020 22:26
@nesnoj nesnoj merged commit 48bfbbf into dev May 10, 2021
@nesnoj nesnoj deleted the fix/#315-deviating-stats branch May 10, 2021 10:31
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.

Deviating statistical key indicators for different Python versions Python 3.4 installation issue Travis
2 participants