Metadata-Version: 2.4
Name: nfit
Version: 0.89.13
Summary: Reduced magnetic-scattering analysis for nearly magnetic metals
Author-email: "Paul M. Neves" <pneves1@jhu.edu>
License-Expression: MIT
Project-URL: Homepage, https://github.com/pmneves7/nfit
Project-URL: Repository, https://github.com/pmneves7/nfit
Project-URL: Documentation, https://nfit.readthedocs.io/
Project-URL: Issues, https://github.com/pmneves7/nfit/issues
Keywords: inelastic neutron scattering,magnetic susceptibility,spin fluctuations,condensed matter physics
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: packaging>=25
Requires-Dist: certifi>=2026.7.22
Requires-Dist: numpy>=2.5
Requires-Dist: scipy>=1.18
Requires-Dist: matplotlib>=3.11.1
Requires-Dist: colorcet>=3.1
Requires-Dist: cmcrameri>=1.10
Requires-Dist: cmocean>=4.0.3
Requires-Dist: palettable>=3.3.3
Requires-Dist: h5py>=3.16
Requires-Dist: pyside6>=6.11.2
Requires-Dist: emcee>=3.1
Requires-Dist: gemmi>=0.6
Requires-Dist: ase>=3.23
Requires-Dist: seekpath>=2.2
Requires-Dist: threadpoolctl>=3.1
Requires-Dist: pyvista>=0.48.4
Requires-Dist: pyvistaqt>=0.13.1
Requires-Dist: imageio>=2.31
Requires-Dist: imageio-ffmpeg>=0.4
Provides-Extra: distribution
Requires-Dist: pyinstaller<7,>=6.22; extra == "distribution"
Provides-Extra: dev
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Requires-Dist: ruff>=0.12; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Requires-Dist: numba>=0.67; extra == "dev"
Requires-Dist: periodictable>=1.7; extra == "dev"
Provides-Extra: accel
Requires-Dist: numba>=0.67; extra == "accel"
Provides-Extra: gpu
Requires-Dist: cupy>=12; extra == "gpu"
Provides-Extra: docs
Requires-Dist: sphinx<10,>=9.1; extra == "docs"
Requires-Dist: myst-parser<6,>=5.1; extra == "docs"
Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
Requires-Dist: furo>=2025.12.19; extra == "docs"
Dynamic: license-file

# nfit

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/pmneves7/nfit/main/docs/_static/nfit-logo-dark.svg">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/pmneves7/nfit/main/docs/_static/nfit-logo.svg">
  <img src="https://raw.githubusercontent.com/pmneves7/nfit/main/docs/_static/nfit-logo.svg" alt="nfit logo" width="240">
</picture>

> **Experimental beta software:** nfit is under active development and may
> contain incomplete or incorrect behavior. Validate scientific results independently.
> Paul M. Neves developed nfit with assistance from AI coding tools.

`nfit` analyzes magnetic neutron-scattering and related bulk measurements.
It works with physical coordinates such as `H`, `K`, `L`, `|Q|`, and energy
transfer, independently of the originating instrument or file layout.

## Install nfit

Download the current application from [GitHub Releases](https://github.com/pmneves7/nfit/releases/latest),
then follow the [macOS, Windows, or Linux installation instructions](docs/desktop_installers.md).
The same guide covers system requirements, updates, and uninstalling nfit.

To install the Python package in an active Python 3.12 or newer environment:

```bash
python -m pip install nfit
nfit
```

On macOS, a [local app launcher](docs/getting_started.md#macos-local-app-launcher)
provides double-click startup and a Dock icon using your existing environment.

A few of its main capabilities are:

- import, combine, mask, rebin, and visualize multidimensional neutron data;
- fit magnetic response models alongside bulk magnetization and heat-capacity data;
- construct and inspect crystal, tight-binding, Lindhard, and RPA models;
- save complete `.nfit` projects and export editable analysis scripts; and
- use native desktop installers or the Python package on macOS, Windows, and Linux.

See the [detailed feature overview](docs/features.md) for the complete capability list.

See the [documentation](docs/index.md) for workflows, physics conventions,
model equations, and the Python API.

## Authorship

nfit was authored and is maintained by Paul M. Neves (Johns Hopkins
University, pneves1@jhu.edu). AI and large-language-model coding tools have
assisted with portions of the code, tests, and documentation. Authorship and
responsibility for the project remain with Paul M. Neves.
See [References and software influences](docs/references.md) for the scientific
and software projects that informed nfit.

## Installation

nfit requires Python 3.12 or newer. The supplied conda environment uses
Python 3.14 and a current NumPy/SciPy/Numba and Qt/VTK stack.

Native macOS, 64-bit Windows 10/11, and 64-bit Ubuntu 22.04 or newer beta
installers provide a self-contained application with the nfit icon, a branded
loading screen, offline help, and consent-based verified updates. Testers do
not need Python, Conda, Git, or the source repository. See
[Desktop installers and updates](docs/desktop_installers.md) for download,
installation, system requirements, and update instructions.

If you are new to Git, Python, and Conda, follow the step-by-step
[first-time source setup guide](docs/getting_started.md#first-time-source-setup).
It covers downloading the public source, installing Git and Miniforge, creating
the `nfit` environment, and launching the application.

For an existing checkout:

```bash
conda env update -f environment.yml --prune
conda activate nfit
```

Launch the project explorer with:

```bash
nfit
```

## Development

Clone the public repository and create the tested development environment:

```bash
git clone https://github.com/pmneves7/nfit.git
cd nfit
conda env create -f environment.yml
conda activate nfit
python -m pip install -e ".[dev,docs,distribution]"
nfit
```

For an existing checkout, use `conda env update -f environment.yml --prune`
before refreshing the editable installation. See the
[developer setup guide](docs/getting_started.md#developer-setup) for the full
workflow and platform notes.

Run the development checks with:

```bash
python -m pytest -q
python -m pytest --cov=nfit --cov-branch --cov-report=term-missing
python -m ruff check
```

## Example

Run the small script-only analysis example:

```bash
python examples/data_playground.py
```

Build the documentation with warnings treated as errors:

```bash
python -m sphinx -W -b html docs docs/_build/html
```

Validate release artifacts locally with:

```bash
python -m build
python -m twine check dist/*
python -m pip install dist/nfit-*.whl
nfit
```

## Documentation

Documentation is built with Sphinx, MyST Markdown, MyST-NB/Jupyter notebooks,
and the Furo theme. User-facing behavior, tests, tooltips, and the relevant
source page should change together.
