Skip to content
Open
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=8192]
Expand All @@ -16,12 +16,12 @@ repos:
- id: trailing-whitespace
exclude: '\.(dat|txt)$'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
rev: v0.16.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.3
hooks:
- id: codespell
2 changes: 0 additions & 2 deletions refl1d_models/LR-cu-film-corefined/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ Run 226652: Return to OCV tNR
Run 226553: OCV
Run 226656: OCV
Run 226659: OCV


22 changes: 10 additions & 12 deletions refl1d_models/polref-ni58-magnetic/reference/Ni58_basic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os
from types import MethodType
from numpy import inf
from refl1d.probe.probe import make_probe
from bumps.parameter import Parameter
from refl1d.probe.probe import make_probe
from bumps.parameter import Parameter
from bumps.util import push_seed
from refl1d.probe.resolution import FWHM2sigma
from pathlib import Path
Expand All @@ -31,12 +31,12 @@ def QT2L(Q, T):
"""
return 4 * np.pi * np.sin(np.radians(T)) / Q

def TOF_loader(T=0.25, dQoQ=0.02,
def TOF_loader(T=0.25, dQoQ=0.02,
Q_sim_range=(0.005, 0.2),
filename=None, skiprows=1, **kw):
"""
Loads and creates NeutronProbe objects for TOF stitched datasets
I.e. from multiple angles. In the case of ISIS NR instruments we
I.e. from multiple angles. In the case of ISIS NR instruments we
typically have a constant dq/q resolution which the data is binned to at
the end of the reduction.

Expand Down Expand Up @@ -69,16 +69,16 @@ def TOF_loader(T=0.25, dQoQ=0.02,
dT = T *dQoQ

probe_out = NeutronProbe(
T=T,
T=T,
dT=dT,
L=L,
dL=0,
L=L,
dL=0,
data=data_in,
# For standard TOF measurements resolution is assumed to be normal (gaussian)
# For measurements with many wavelengths and many angles (say cw measurements)
# then a uniform resolution can be used instead.
resolution='normal',
**kw
**kw
)

return probe_out
Expand All @@ -94,9 +94,9 @@ def load_probe_polref(filename, angle, dQoQ, name=None, path=None, pol_mode=None
name = filename
if path is None:
path = os.getcwd()

filepath = Path(path)/filename

if (pol_mode != "pnr") and (pol_mode != "pa"):
probe = TOF_loader(T=angle, dQoQ=dQoQ, filename=f"{filepath}.dat", name=name, **kw)

Expand Down Expand Up @@ -212,5 +212,3 @@ def load_probe_polref(filename, angle, dQoQ, name=None, path=None, pol_mode=None
experiment = Experiment(probe=probe, sample=sample, dz=zed, step_interfaces=step, auto_tag=True)

problem = FitProblem(experiment)