Skip to content

Commit

Permalink
Merge branch 'test_audit' into 'master'
Browse files Browse the repository at this point in the history
Improvement of CoreMS tests

See merge request mass-spectrometry/corems!126
  • Loading branch information
corilo committed Oct 25, 2024
2 parents f21afc6 + 980f7dc commit fec7968
Show file tree
Hide file tree
Showing 29 changed files with 893 additions and 2,177 deletions.
446 changes: 0 additions & 446 deletions SettingsCoreMS.json

This file was deleted.

172 changes: 0 additions & 172 deletions SettingsCoreMS.toml

This file was deleted.

36 changes: 36 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import pytest
from pathlib import Path

from corems.transient.input.brukerSolarix import ReadBrukerSolarix
from corems.encapsulation.factory.parameters import MSParameters

@pytest.fixture
def mass_spectrum_ftms(bruker_transient):
"""Creates a mass spectrum object to be used in the tests"""
# Instantiate the mass spectrum object
mass_spectrum = bruker_transient.get_mass_spectrum(
plot_result=False, auto_process=False, keep_profile=True
)
mass_spectrum.parameters = MSParameters(use_defaults=True)
# Process the mass spectrum
mass_spectrum.process_mass_spec()

return mass_spectrum

@pytest.fixture
def ref_file_location():
"""Returns the location of the reference file for calibration for the tests"""
return Path.cwd() / "tests/tests_data/ftms/SRFA.ref"

@pytest.fixture
def ftms_file_location():
"""Returns the location of the FTMS file for the tests"""
return Path.cwd() / "tests/tests_data/ftms/ESI_NEG_SRFA.d/"

@pytest.fixture
def bruker_transient(ftms_file_location):
"""Returns the transient object for the FTMS file"""
bruker_reader = ReadBrukerSolarix(ftms_file_location)
bruker_transient = bruker_reader.get_transient()

return bruker_transient
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[pytest]
# To run tests with coverage, uncomment the following line
addopts = -ra -v --cov=corems --cov-config=pytest.ini --cov-report html --cov-report term -p no:warnings
norecursedirs = win_only
testpaths = tests
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pylint
pytest~=7.2.1
pytest-cov
pytest~=8.3.2
pytest-cov~=5.0.0
pyprof2calltree
memory_profiler
twine
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'''
import sys
sys.path.append(".")
Expand Down Expand Up @@ -46,3 +47,4 @@
mass_spec = lcms.get_mass_spec_by_scan_number(1)
mass_spec.plot_mz_domain_profile()
mass_spec.plot_profile_and_noise_threshold()
'''
20 changes: 0 additions & 20 deletions tests/chemstation.py

This file was deleted.

65 changes: 0 additions & 65 deletions tests/test.py

This file was deleted.

50 changes: 0 additions & 50 deletions tests/test_aaaaa_thermo.py-disable

This file was deleted.

Loading

0 comments on commit fec7968

Please sign in to comment.