Skip to content

Commit

Permalink
Merge pull request #27 from brainglobe/smg/tests-refactor
Browse files Browse the repository at this point in the history
Refactor tests
  • Loading branch information
sfmig authored Dec 16, 2023
2 parents 4a693de + 466667c commit 24f2592
Show file tree
Hide file tree
Showing 27 changed files with 1,485 additions and 937 deletions.
7 changes: 4 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ exclude *.yaml
exclude *.yml
exclude Dockerfile
exclude *.ini
exclude asv.conf.json
exclude brainglobe_workflows/cellfinder/default_config.json

recursive-include brainglobe_workflows *.py
recursive-include brainglobe_workflows/configs *.json
recursive-include brainglobe_benchmarks *.py
recursive-exclude brainglobe_benchmarks/results *
include asv.conf.json

recursive-exclude * __pycache__
recursive-exclude * *.py[co]

global-include *.pxd

prune benchmarks
prune docs
prune tests
prune resources
Expand Down
13 changes: 7 additions & 6 deletions asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

// The URL or local path of the source code repository for the
// project being benchmarked
"repo": ".",
// "repo": ".",
"repo": "https://github.com/brainglobe/brainglobe-workflows",

// The Python project's subdirectory in your repo. If missing or
// the empty string, the project is assumed to be located at the root
Expand Down Expand Up @@ -39,14 +40,14 @@

// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "default" (for mercurial).
"branches": ["main"], // for git
"branches": ["smg/tests-refactor"], // for git
// "branches": ["default"], // for mercurial

// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
// "dvcs": "git",
"dvcs": "git",

// The tool to use to create environments. May be "conda",
// "virtualenv", "mamba" (above 3.8)
Expand Down Expand Up @@ -146,19 +147,19 @@

// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
// "benchmark_dir": "benchmarks",
"benchmark_dir": "brainglobe_benchmarks",

// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
"env_dir": ".asv/env",

// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": "benchmarks/results",
"results_dir": "brainglobe_benchmarks/results",

// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
"html_dir": "benchmarks/html",
"html_dir": "brainglobe_benchmarks/html",

// The number of characters to retain in the commit hashes.
// "hash_length": 8,
Expand Down
File renamed without changes.
12 changes: 5 additions & 7 deletions benchmarks/cellfinder.py → brainglobe_benchmarks/cellfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
from cellfinder_core.main import main as cellfinder_run
from cellfinder_core.tools.IO import read_with_dask

from brainglobe_workflows.cellfinder.cellfinder_main import (
DEFAULT_JSON_CONFIG_PATH,
from brainglobe_workflows.cellfinder import (
CellfinderConfig,
run_workflow_from_cellfinder_run,
)
from brainglobe_workflows.cellfinder.cellfinder_main import (
setup as setup_cellfinder_workflow,
)
from brainglobe_workflows.cellfinder import setup as setup_cellfinder_workflow
from brainglobe_workflows.utils import DEFAULT_JSON_CONFIG_PATH_CELLFINDER


class TimeBenchmarkPrepGIN:
Expand Down Expand Up @@ -79,7 +77,7 @@ class TimeBenchmarkPrepGIN:
min_run_count = 2 # default:2

# Custom attributes
input_config_path = str(DEFAULT_JSON_CONFIG_PATH)
input_config_path = str(DEFAULT_JSON_CONFIG_PATH_CELLFINDER)

def setup_cache(
self,
Expand Down Expand Up @@ -114,7 +112,7 @@ def setup_cache(
known_hash=config.data_hash,
path=config.install_path,
progressbar=True,
processor=pooch.Unzip(extract_dir=config.extract_dir_relative),
processor=pooch.Unzip(extract_dir=config.data_dir_relative),
)

# Check paths to input data should now exist in config
Expand Down
Loading

0 comments on commit 24f2592

Please sign in to comment.