From 24ecc6970f2b66c545c126673d2a27ab6970f7f8 Mon Sep 17 00:00:00 2001 From: Gabriel Schubiner Date: Thu, 23 May 2024 12:24:11 -0400 Subject: [PATCH] Add initial version of bidsi. --- src/bidsi/__init__.py | 2 +- src/bidsi/algorithms.py | 23 ----------------------- tests/test_fibonacci.py | 33 --------------------------------- 3 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 src/bidsi/algorithms.py delete mode 100644 tests/test_fibonacci.py diff --git a/src/bidsi/__init__.py b/src/bidsi/__init__.py index 7cff8c5..76e108c 100644 --- a/src/bidsi/__init__.py +++ b/src/bidsi/__init__.py @@ -1 +1 @@ -""".. include:: ../../README.md""" # noqa: D415 +"""Generate BIDS Structure.""" diff --git a/src/bidsi/algorithms.py b/src/bidsi/algorithms.py deleted file mode 100644 index 71ca49c..0000000 --- a/src/bidsi/algorithms.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Example functions for bidsi.""" - - -def fibonacci(n: int) -> int: - """Return the n-th Fibonacci number. - - Args: - n: The index of the Fibonacci number to return. - - Returns: - The n-th Fibonacci number. - """ - if n < 0: - raise ValueError("n must be non-negative") - - if int(n) != n: - raise ValueError("n must be an integer") - - if n == 0: - return 0 - if n <= 2: - return 1 - return fibonacci(n - 1) + fibonacci(n - 2) diff --git a/tests/test_fibonacci.py b/tests/test_fibonacci.py deleted file mode 100644 index 79880d3..0000000 --- a/tests/test_fibonacci.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Tests for the fibonacci() function.""" - -import pytest - -from bidsi import algorithms - - -def test_fibonacci_success_0() -> None: - """Test that fibonacci() returns the correct value for valid input.""" - output = algorithms.fibonacci(0) - - assert output == 0 - - -def test_fibonacci_success_18() -> None: - """Test that fibonacci() returns the correct value for valid input.""" - expected = 4181 - - actual = algorithms.fibonacci(19) - - assert actual == expected - - -def test_fibonacci_negative() -> None: - """Test that fibonacci() raises an exception for negative input.""" - with pytest.raises(ValueError): - algorithms.fibonacci(-1) - - -def test_fibonacci_non_integer() -> None: - """Test that fibonacci() raises an exception for non-integer input.""" - with pytest.raises(ValueError): - algorithms.fibonacci(3.14) # type: ignore[arg-type]