Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c/subprojects/kastore/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.1
2.1.2
2 changes: 1 addition & 1 deletion c/subprojects/kastore/kastore.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ to the API or ABI are introduced, i.e., the addition of a new function.
The library patch version. Incremented when any changes not relevant to the
to the API or ABI are introduced, i.e., internal refactors of bugfixes.
*/
#define KAS_VERSION_PATCH 1
#define KAS_VERSION_PATCH 2
/** @} */

#define KAS_HEADER_SIZE 64
Expand Down
26 changes: 15 additions & 11 deletions c/subprojects/kastore/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,29 @@ if not meson.is_subproject()
shared_library('kastore', 'kastore.c', install: true)
executable('example', ['example.c'], link_with: kastore)

# Note: we don't declare these as meson tests because they depend on
# being run from the current working directory because of the paths
# to example files.
cunit_dep = dependency('cunit')
executable('tests', ['tests.c', 'kastore.c'], dependencies: cunit_dep,
src_root = meson.project_source_root()

tests_exe = executable('tests', ['tests.c', 'kastore.c'], dependencies: cunit_dep,
c_args: ['-DMESON_VERSION="@0@"'.format(meson.project_version())])
test('tests', tests_exe,
env: ['KAS_TEST_DATA_PREFIX=' + src_root + '/test-data/'])

executable('cpp_tests', ['cpp_tests.cpp'], link_with: kastore)
cpp_tests_exe = executable('cpp_tests', ['cpp_tests.cpp'], link_with: kastore)
test('cpp_tests', cpp_tests_exe)

executable('malloc_tests', ['malloc_tests.c', 'kastore.c'],
dependencies: cunit_dep,
malloc_tests_exe = executable('malloc_tests', ['malloc_tests.c', 'kastore.c'],
dependencies: cunit_dep,
link_args:['-Wl,--wrap=malloc', '-Wl,--wrap=realloc', '-Wl,--wrap=calloc'])
test('malloc_tests', malloc_tests_exe, workdir: src_root)

executable('io_tests', ['io_tests.c', 'kastore.c'],
dependencies: cunit_dep,
io_tests_exe = executable('io_tests', ['io_tests.c', 'kastore.c'],
dependencies: cunit_dep,
link_args:[
'-Wl,--wrap=fwrite',
'-Wl,--wrap=fread',
'-Wl,--wrap=fwrite',
'-Wl,--wrap=fread',
'-Wl,--wrap=fclose',
'-Wl,--wrap=ftell',
'-Wl,--wrap=fseek'])
test('io_tests', io_tests_exe, workdir: src_root)
endif
10 changes: 2 additions & 8 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
PYTHON := $(shell command -v python 2> /dev/null)
ifndef PYTHON
$(error "python is not available via the `python` executable. If you have python only via `python3` you may need to `apt install python-is-python3`")
endif

all: ext3

allchecks: _tskitmodule.c
CFLAGS="-std=c99 --coverage -Wall -Wextra -Werror -Wno-unused-parameter -Wno-cast-function-type" \
python setup.py build_ext --inplace
uv run python setup.py build_ext --inplace

ext3: _tskitmodule.c

python setup.py build_ext --inplace
uv run python setup.py build_ext --inplace

ctags:
ctags lib/*.c lib/*.h tskit/*.py
Expand Down
20 changes: 10 additions & 10 deletions python/tests/test_python_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -5073,7 +5073,7 @@ class TestModuleFunctions:

def test_kastore_version(self):
version = _tskit.get_kastore_version()
assert version == (2, 1, 1)
assert version == (2, 1, 2)

def test_tskit_version(self):
version = _tskit.get_tskit_version()
Expand Down Expand Up @@ -5365,15 +5365,6 @@ def test_cpy_bad_node_bin_map(self):
with pytest.raises(TypeError, match="cast array data"):
self.pair_coalescence_quantiles(ts, node_bin_map=np.zeros(num_nodes))

def test_cpy_bad_quantiles(self):
ts = self.example_ts()
quantiles = np.zeros(0)
with pytest.raises(ValueError, match="at least one quantile"):
self.pair_coalescence_quantiles(ts, quantiles=quantiles)
quantiles = np.zeros((3, 3))
with pytest.raises(ValueError, match="object too deep"):
self.pair_coalescence_quantiles(ts, quantiles=quantiles)

def test_cpy_bad_inputs(self):
ts = self.example_ts()
with pytest.raises(TypeError, match="at most 6 keyword"):
Expand All @@ -5387,6 +5378,15 @@ def test_cpy_bad_inputs(self):
foo="bar",
)

def test_cpy_bad_quantiles(self):
ts = self.example_ts()
quantiles = np.zeros(0)
with pytest.raises(ValueError, match="at least one quantile"):
self.pair_coalescence_quantiles(ts, quantiles=quantiles)
quantiles = np.zeros((3, 3))
with pytest.raises(ValueError, match="object too deep"):
self.pair_coalescence_quantiles(ts, quantiles=quantiles)


class TestPairCoalescenceRatesErrors:
def example_ts(self, sample_size=10):
Expand Down
Loading