Skip to content

Commit

Permalink
Remove unnecessary warning traceback, move TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
f0uriest committed Aug 31, 2023
1 parent 4476cfe commit 9bddd54
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
13 changes: 0 additions & 13 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"""Test fixtures for computing equilibria etc."""

import os
import sys
import traceback
import warnings

import h5py
import numpy as np
Expand All @@ -15,16 +12,6 @@
from desc.vmec import VMECIO


# print full tracebacks to help find sources of warnings
def _warn_with_traceback(message, category, filename, lineno, file=None, line=None):
log = file if hasattr(file, "write") else sys.stderr
traceback.print_stack(file=log)
log.write(warnings.formatwarning(message, category, filename, lineno, line))


warnings.showwarning = _warn_with_traceback


@pytest.fixture(scope="session")
def TmpDir(tmpdir_factory):
"""Create a temporary directory to store testing files."""
Expand Down
3 changes: 1 addition & 2 deletions tests/test_compute_funs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def myconvolve_2d(arr_1d, stencil, shape):
return conv


# TODO: add more tests for compute_geometry
@pytest.mark.unit
def test_total_volume(DummyStellarator):
"""Test that the volume enclosed by the LCFS is equal to the total volume."""
Expand Down Expand Up @@ -1114,11 +1113,11 @@ def test_partial_derivative(name):
test_partial_derivative("(B*grad(|B|))_z")


# TODO: add test with stellarator example
@pytest.mark.unit
@pytest.mark.solve
def test_boozer_transform(DSHAPE_current):
"""Test that Boozer coordinate transform agrees with BOOZ_XFORM."""
# TODO: add test with stellarator example
eq = EquilibriaFamily.load(load_from=str(DSHAPE_current["desc_h5_path"]))[-1]
grid = LinearGrid(M=eq.M_grid, N=eq.N_grid, NFP=eq.NFP)
data = eq.compute("|B|_mn", grid=grid, M_booz=eq.M, N_booz=eq.N)
Expand Down

0 comments on commit 9bddd54

Please sign in to comment.