Skip to content

Commit

Permalink
migrate to 'src' directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
whitews committed Sep 27, 2023
1 parent 23162d1 commit f376eac
Show file tree
Hide file tree
Showing 24 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unittest


unittest.main('flowutils.tests')
unittest.main('tests')
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np # NumPy is needed to build C extensions

# read in version string
VERSION_FILE = 'flowutils/_version.py'
VERSION_FILE = 'src/flowutils/_version.py'
__version__ = None # to avoid inspection warning and check if __version__ was loaded
exec(open(VERSION_FILE).read())

Expand All @@ -18,27 +18,28 @@
logicle_extension = Extension(
'flowutils.logicle_c',
sources=[
'flowutils/logicle_c_ext/_logicle.c',
'flowutils/logicle_c_ext/logicle.c'
'src/flowutils/logicle_c_ext/_logicle.c',
'src/flowutils/logicle_c_ext/logicle.c'
],
include_dirs=[np.get_include(), 'flowutils/logicle_c_ext'],
include_dirs=[np.get_include(), 'src/flowutils/logicle_c_ext'],
extra_compile_args=['-std=c99']
)

gating_extension = Extension(
'flowutils.gating_c',
sources=[
'flowutils/gating_c_ext/_gate_helpers.c',
'flowutils/gating_c_ext/gate_helpers.c'
'src/flowutils/gating_c_ext/_gate_helpers.c',
'src/flowutils/gating_c_ext/gate_helpers.c'
],
include_dirs=[np.get_include(), 'flowutils/gating_c_ext'],
include_dirs=[np.get_include(), 'src/flowutils/gating_c_ext'],
extra_compile_args=['-std=c99']
)

setup(
name='FlowUtils',
version=__version__, # noqa PyTypeChecker
packages=['flowutils'],
package_dir={'': "src"},
package_data={'': []},
description='Flow Cytometry Standard Utilities',
long_description=long_description,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
'G560-A'
]

test_data_npy_path = "flowutils/tests/test_data/test_comp_event_data.npy"
test_comp_csv_path = "flowutils/tests/test_data/test_comp_matrix.csv"
test_data_npy_path = "tests/test_data/test_comp_event_data.npy"
test_comp_csv_path = "tests/test_data/test_comp_matrix.csv"
test_data_channels = [
'FSC-A', 'FSC-W', 'SSC-A',
'Ax488-A', 'PE-A', 'PE-TR-A',
Expand Down Expand Up @@ -108,7 +108,7 @@ def test_parse_compensation_matrix_from_path(self):
self.assertIsInstance(matrix_array, np.ndarray)

def test_parse_compensation_matrix_missing_row(self):
comp_path = pathlib.Path("flowutils/tests/test_data/test_comp_matrix_missing_row.csv")
comp_path = pathlib.Path("tests/test_data/test_comp_matrix_missing_row.csv")

self.assertRaises(
ValueError,
Expand Down
8 changes: 4 additions & 4 deletions flowutils/tests/gating_tests.py → tests/gating_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def test_points_in_ellipse():
coords = [12.99701, 16.22941]
distance_square = 1.0

npy_file_path = "flowutils/tests/test_data/event_data_for_ellipse_test.npy"
npy_file_path = "tests/test_data/event_data_for_ellipse_test.npy"
event_data = np.load(npy_file_path)

truth_path = 'flowutils/tests/test_data/truth/Results_Ellipse1.txt'
truth_path = 'tests/test_data/truth/Results_Ellipse1.txt'
truth = np.genfromtxt(truth_path, delimiter=',').astype('bool')

result = gating.points_in_ellipsoid(
Expand All @@ -39,10 +39,10 @@ def test_points_in_polygon():
]
)

npy_file_path = "flowutils/tests/test_data/event_data_for_poly_test.npy"
npy_file_path = "tests/test_data/event_data_for_poly_test.npy"
event_data = np.load(npy_file_path)

truth_path = 'flowutils/tests/test_data/truth/Results_Polygon4.txt'
truth_path = 'tests/test_data/truth/Results_Polygon4.txt'
truth = np.genfromtxt(truth_path, delimiter=',').astype('bool')

result = gating.points_in_polygon(poly_vertices, event_data)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f376eac

Please sign in to comment.