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

tests for new native based lettuce version #213

Merged

Conversation

PhiSpel
Copy link
Contributor

@PhiSpel PhiSpel commented Aug 16, 2024

Description

closes #172
closes #112
closes #119
closes #186

Checklist

  • This pull request is associated to an issue
  • This PR contains a description
  • Did you add a new method? If so, you need to
    • add method description
    • maybe mention class in the corresponding __init__
    • add an example using the method in examples/advanced_flows/ or examples/simple_flows/
    • add a test in tests/
  • Add someone else as reviewer and wait for approval before merging.
  • test_boundaries.py
  • test_cli.py
  • test_collision.py
  • test_equilibrium.py
  • test_flows.py
  • rerun couette, decayingturbulence, doublyshear, poiseuille
  • test_force.py
  • test_lattices.py
  • test_moments.py
  • test_native.py
  • test_observables.py
  • test_readme.py
  • test_reporters.py
  • test_simulation.py
  • test_stencils.py
  • test_streaming.py
  • test_unit.py
  • test_util.py

Synopsis

  1. Flow:
    1. Made f inputs to methods optional
    2. removed some redundant passing of f to rho() - this is a continuation of Update examples to cuda-native architecture #198
    3. added initialize_pressure and initialize_fneq properties (default False) and, depending on them, additional pressure_poisson and initialize_fneq methods. The latter could still be in a different file, but they are only used in Flow.
  2. Boundary
    1. Passing a Flow instead of Context to get the torch_stencil
    2. Removed call of flow.collision in AntiBounceBackOutlet as this is not always available (see [Feature]: Let boundaries choose to affect collision OR streaming #212)
  3. Transform: I worked around the issue of things such as mv() belonging to Flow (see [Bug]: Moment transforms require many methods from deprecated Lattice #222).
  4. BGKCollision: removed redundant call of flow.rho()
  5. BGKInitialisation: removed as deprecated
  6. CouetteFlow: Cosmetics and generalized u0
  7. DecayingTurbulence:
    1. Instantiate stencil before super() call.
    2. Added initialize_fneq and initialize_pressure
    3. Give self.randseed to allow deterministic tests.
  8. DoublyPeriodicShear2D:
    1. Fixed some minor bugs with self.resolution
    2. added initialize_fneq
    3. added typing
  9. LidDrivenCavity: Cosmetics
  10. Obstacle: Cosmetics
  11. Poiseuille:
    1. Major: fixed resolution-gridsize-l_char_lu interaction.
    2. Default stencil
    3. Minor: Cosmetics, typing
  12. TaylorGreenVortex:
    1. Major: reverted UnitConversion (mistake from Update examples to cuda-native architecture #198 ) to arrive at identical solution from old master (l_char_LU = 2pi)
    2. instantiate stencil properly
    3. default initialize_fneq
  13. Force, Guo, ShanChen: Added abstract __init__ using Flow instead of Context for Guo to have access to torch_stencil,
  14. Guo: updated to native architecture
  15. ErrorReporter: cosmetics
  16. ObservableReporter: Made Observable an ABC Class and made f inputs optional
  17. VTKReporter: changed convert_to_numpy to convert_to_ndarray
  18. HDF5Reporter: Update to native and inherit from Reporter class
  19. moments.py:
    1. Allow passing stencil as class or as instance
    2. Typing and update from lattice to context
    3. Pass a Flow to Transform.equilibrium() to get its equilibrium, densitiy, and velocity
    4. Added einsum and mv to be independent of changes in .../_Flow/
  20. utility.py:
    1. moved pressure_poisson to .../_Flow/
    2. minor updates to native
  21. Migrated everything from ./old_tests/
    1. Removed conftest.py: This is now all in tests/common.py
    2. Removed test_readme.py: This is tedious to update manually and in Update README.rst #157 I suggest anyway to remove the code snippet and instead to refer straight to the example files.
  22. tests/common.py: Added collection of Collision subclasses and those with conservation properties.
  23. tests/native/__init__.py: Skipping native tests alltogether if cuda is not available (in CI).
  24. tests/simulation:
    1. removed test_load_and_dump b/c save_checkpoint is deprecated and we should deal with this whole issue separately in HDF5 Writer limits grid resolution #119 and added a test for dump and load #224
    2. removed deprecated test_initialization to test_initialize_pressure (non-Jacobi was discouraged anyway)
  25. Other tests were 1:1 migrated.

@PhiSpel PhiSpel self-assigned this Aug 16, 2024
@PhiSpel PhiSpel linked an issue Aug 16, 2024 that may be closed by this pull request
19 tasks
@pep8speaks
Copy link

pep8speaks commented Aug 16, 2024

Hello @PhiSpel! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-08-20 14:54:06 UTC

@PhiSpel PhiSpel requested a review from McBs August 21, 2024 15:19
PhiSpel and others added 16 commits August 21, 2024 17:22
…tead of returning different lists in device_params
…-version' into 112-convergence-tool-should-be-run-as-a-test
…tead of returning different lists in device_params
…tead of returning different lists in device_params
* Update CI.yml (#228)

runs-on: self-hosted (workstation-mcbs)

* Update CI.yml (#229)

* Update CI.yml

* Update CI.yml

* Update CI.yml

* removed conftest.py

* renamed common.py to conftest.py for pytest to recognize it

* not importing Flow to moments.py

* not importing Flow to inc_quad_eq
only import TorchStencil to _flow

* removed default Transform imports to avoid cyclic import

* pep8 cosmetics

---------

Co-authored-by: Mario Bedrunka <[email protected]>
* added test_checkpoint and adapted poiseuille.py flow to new architecture

* pep8 cosmetics
…-version' into 112-convergence-tool-should-be-run-as-a-test
…-version' into 112-convergence-tool-should-be-run-as-a-test
@PhiSpel PhiSpel changed the title 172 adjust and adapt tests for new native based lettuce version adjust and adapt tests for new native based lettuce version Aug 22, 2024
@PhiSpel PhiSpel changed the title adjust and adapt tests for new native based lettuce version tests for new native based lettuce version Aug 22, 2024
PhiSpel and others added 3 commits August 22, 2024 15:54
…e-run-as-a-test

running convergence tool as a test
…new-native-based-lettuce-version

# Conflicts:
#	lettuce/util/moments.py
#	tests/native/test_native_bgk_collision.py
@PhiSpel PhiSpel marked this pull request as ready for review August 22, 2024 14:08
Copy link
Contributor

@McBs McBs left a comment

Choose a reason for hiding this comment

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

lgtm. Thanks! :-)

@PhiSpel PhiSpel merged commit 55a21c9 into master Aug 22, 2024
9 of 10 checks passed
@PhiSpel PhiSpel deleted the 172-adjust-and-adapt-tests-for-new-native-based-lettuce-version branch August 22, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants