semvec/pypi-packages huggingface dataset:
pytest-datadir 1.8.0
pytest plugin for test data directories and files
License: MIT
Requires Python: >=3.8
Keywords: pytest, test, unittest, directory, file

# pytest-datadir

pytest plugin for manipulating test data directories and files.

[![Build Status](https://github.com/gabrielcnr/pytest-datadir/workflows/build/badge.svg?branch=master)](https://github.com/gabrielcnr/pytest-datadir/workflows/build/badge.svg?branch=master)
[![PyPI](https://img.shields.io/pypi/v/pytest-datadir.svg)](https://pypi.python.org/pypi/pytest-datadir)
[![CondaForge](https://img.shields.io/conda/vn/conda-forge/pytest-datadir.svg)](https://anaconda.org/conda-forge/pytest-datadir)
![Python Version](https://img.shields.io/badge/python-3.6+-blue.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)


# Usage

`pytest-datadir` automatically looks for a directory matching your module's name or a global `data` folder.

Consider the following directory structure:

```
.
├── data/
│   └── hello.txt
├── test_hello/
│   └── spam.txt
└── test_hello.py
```

You can access file contents using the injected fixtures:

- `datadir` (for module-specific `test_*` folders)
- `shared_datadir` (for the global `data` folder)

```python
def test_read_global(shared_datadir):
    contents = (shared_datadir / "hello.txt").read_text()
    assert contents == "Hello World!\n"


def test_read_module(datadir):
    contents = (datadir / "spam.txt").read_text()
    assert contents == "eggs\n"
```

The contents of the data directory are copied to a temporary folder, ensuring safe file modifications without affecting other tests or original files.

Both `datadir` and `shared_datadir` fixtures return `pathlib.Path` objects.

## lazy_datadir

Version 1.7.0 introduced the `lazy_datadir` fixture, which only copies files and directories when accessed via the `joinpath` method or the `/` operator.

```python
def test_read_module(lazy_datadir):
    contents = (lazy_datadir / "spam.txt").read_text()
    assert contents == "eggs\n"
```

Unlike `datadir`, `lazy_datadir` is an object that only implements `joinpath` and `/` operations. While not fully backward-compatible with `datadir`, most tests can switch to `lazy_datadir` without modifications.

### lazy_shared_datadir

`lazy_shared_datadir` is similar to `lazy_datadir`, but applied to the shared data directory `shared_datadir`.
That is, instead of copying all files in `shared_datadir`, files are only copied as necessary when accessed via `joinpath` or the `/` operator.
This allows for a shared data directory to be pulled from lazily in the same manner as `lazy_datadir`.

```python
def test_read_global(lazy_shared_datadir):
    contents = (lazy_shared_datadir / "hello.txt").read_text()
    assert contents == "Hello World!\n"
```

# License

MIT.
neurostrip 1.0.1
CNN based skull stripping (brain masking) from MRI
License: MIT
Requires Python: >=3.9
Keywords: MRI, skull stripping, brain masking, CNN, medical imaging

# NeuroStrip
[![CI](https://github.com/dyollb/neurostrip/actions/workflows/ci.yml/badge.svg)](https://github.com/dyollb/neurostrip/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![PyPI](https://img.shields.io/pypi/v/neurostrip.svg)](https://pypi.org/project/neurostrip/)
<img src="https://img.shields.io/pypi/dm/neurostrip.svg?label=pypi%20downloads&logo=python&logoColor=green"/>
<img src="https://img.shields.io/badge/python-3.9%20|3.10%20|%203.11%20|%203.12-3776ab.svg"/>

CNN based skull stripping (brain masking) from MRI.

<p align="center">
   <img src="https://raw.githubusercontent.com/dyollb/neurostrip/main/slicer_plugin/Resources/Icons/NeuroStrip.png" alt="NeuroStrip Slicer Plugin Icon" width="120"/>
</p>

## Installation

For CPU support:
```bash
pip install neurostrip[cpu]
```

For GPU support:
```bash
pip install neurostrip[gpu]
```

## Usage

```bash
neurostrip --image-path input.nii.gz --mask-path mask.nii.gz --masked-image-path output.nii.gz
```

## Slicer Plugin

To make it more convenient to use, this repository includes a plugin that can be installed in [3D Slicer](https://www.slicer.org/). For installation instructions and more details, please refer to the [README](https://raw.githubusercontent.com/dyollb/neurostrip/main/slicer_plugin/README.md).

## Contributing

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.

## License

MIT License - see LICENSE file for details.