Skip to content

Commit

Permalink
More linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Sep 16, 2024
1 parent 12b23f7 commit 0cd2164
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
from euphonic import Quantity, ureg
from euphonic.spectra import OneLineData, Spectrum2D, Spectrum2DCollection

# def check_spectrum2d(actual_spectrum2d, expected_spectrum2d, equal_nan=False,
# z_atol=np.finfo(np.float64).eps):


def rand_spectrum2d(seed: int = 1,
x_bins: Optional[Quantity] = None,
y_bins: Optional[Quantity] = None,
metadata: Optional[OneLineData] = None) -> Spectrum2D:
"""Generate a Spectrum2D with random axis lengths, ranges, and metadata"""
rng = np.random.default_rng(seed=seed)

if x_bins is None:
Expand All @@ -38,6 +36,7 @@ def rand_spectrum2d(seed: int = 1,

class TestSpectrum2DCollectionCreation:

Check notice on line 37 in tests_and_analysis/test/euphonic_test/test_spectrum2dcollection.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

tests_and_analysis/test/euphonic_test/test_spectrum2dcollection.py#L37

Missing class docstring
def test_init_from_numbers(self):
"""Construct Spectrum2DCollection with __init__()"""
N_X = 10

Check notice on line 40 in tests_and_analysis/test/euphonic_test/test_spectrum2dcollection.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

tests_and_analysis/test/euphonic_test/test_spectrum2dcollection.py#L40

Variable name "N_X" doesn't conform to snake_case naming style
N_Y = 20

Check notice on line 41 in tests_and_analysis/test/euphonic_test/test_spectrum2dcollection.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

tests_and_analysis/test/euphonic_test/test_spectrum2dcollection.py#L41

Variable name "N_Y" doesn't conform to snake_case naming style
N_Z = 5

Check notice on line 42 in tests_and_analysis/test/euphonic_test/test_spectrum2dcollection.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

tests_and_analysis/test/euphonic_test/test_spectrum2dcollection.py#L42

Variable name "N_Z" doesn't conform to snake_case naming style
Expand All @@ -58,6 +57,7 @@ def test_init_from_numbers(self):
assert spectrum

def test_init_from_spectra(self):
"""Construct collection from a series of Spectrum2D"""
spec_2d = rand_spectrum2d(seed=1)
spec_2d_consistent = rand_spectrum2d().copy()
spec_2d_consistent._z_data *= 2
Expand Down

0 comments on commit 0cd2164

Please sign in to comment.