Skip to content

Commit

Permalink
fix: remove 'reflectometry' submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
jokasimr committed Oct 25, 2023
1 parent b68ab60 commit f6b242a
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 35 deletions.
4 changes: 2 additions & 2 deletions docs/examples/amor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"import scipp as sc\n",
"import sciline\n",
"from essreflectometry.amor import providers, default_parameters\n",
"from essreflectometry.reflectometry.types import *\n",
"from essreflectometry.types import *\n",
"from essreflectometry.amor.types import SampleRotation"
]
},
Expand Down Expand Up @@ -102,7 +102,7 @@
"metadata": {},
"outputs": [],
"source": [
"from essreflectometry.reflectometry.types import ThetaData\n",
"from essreflectometry.types import ThetaData\n",
"pipeline.compute(ThetaData[Sample])\\\n",
" .bins.concat('detector_number')\\\n",
" .hist(\n",
Expand Down
12 changes: 11 additions & 1 deletion src/essreflectometry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)

# flake8: noqa
# flake8: noqa: F401
import importlib.metadata
from itertools import chain

try:
__version__ = importlib.metadata.version(__package__ or __name__)
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.0"

from . import conversions, corrections, io

providers = list(
chain(
conversions.providers,
corrections.providers,
)
)
12 changes: 5 additions & 7 deletions src/essreflectometry/amor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
from itertools import chain

import scipp as sc
from scipp.constants import g

from ..reflectometry import providers as reflectometry_providers
from ..reflectometry.types import Run
from . import beamline, calibrations, conversions, load, normalize, resolution, tools

# from .beamline import instrument_view_components
from .. import providers as reflectometry_providers
from ..types import Run
from . import beamline, calibrations, conversions, load, normalize, resolution
from .beamline import instrument_view_components
from .instrument_view import instrument_view
from .types import *

Expand All @@ -33,7 +31,7 @@
BeamSize[Run]: 2.0 * sc.units.mm,
SampleSize[Run]: 10.0 * sc.units.mm,
DetectorSpatialResolution[Run]: 0.0025 * sc.units.m,
Gravity: sc.vector(value=[0, -1, 0]) * g,
Gravity: sc.vector(value=[0, -1, 0]) * sc.constants.g,
ChopperFrequency[Run]: sc.scalar(20 / 3, unit='Hz'),
ChopperPhase[Run]: sc.scalar(-8.0, unit='deg'),
Chopper1Position[Run]: sc.vector(value=[0, 0, -15.5], unit='m'),
Expand Down
2 changes: 1 addition & 1 deletion src/essreflectometry/amor/beamline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ..choppers import make_chopper
from ..logging import log_call
from ..reflectometry.types import BeamlineParams, Run
from ..types import BeamlineParams, Run
from .types import (
BeamSize,
Chopper1Position,
Expand Down
2 changes: 1 addition & 1 deletion src/essreflectometry/amor/calibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import scipp as sc

# from ..reflectometry import orso
from ..reflectometry.types import CalibratedReference, Histogrammed, Reference
from ..types import CalibratedReference, Histogrammed, Reference
from .types import Alpha, CriticalEdge, MValue, Supermirror


Expand Down
4 changes: 2 additions & 2 deletions src/essreflectometry/amor/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
import scipp as sc

from ..reflectometry.conversions import specular_reflection as spec_relf_graph
from ..reflectometry.types import SpecularReflectionCoordTransformGraph
from ..conversions import specular_reflection as spec_relf_graph
from ..types import SpecularReflectionCoordTransformGraph


def incident_beam(
Expand Down
2 changes: 1 addition & 1 deletion src/essreflectometry/amor/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import scippnexus as snx

from ..logging import get_logger
from ..reflectometry.types import BeamlineParams, Filename, Raw, Run
from ..types import BeamlineParams, Filename, Raw, Run
from .data import get_path


Expand Down
2 changes: 1 addition & 1 deletion src/essreflectometry/amor/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import scipp as sc

# from ..reflectometry import orso
from ..reflectometry.types import Normalized, NormalizedIOfQ, Reference, Sample
from ..types import Normalized, NormalizedIOfQ, Reference, Sample


def normalize_by_supermirror(
Expand Down
4 changes: 2 additions & 2 deletions src/essreflectometry/amor/resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
import scipp as sc

from ..reflectometry.types import (
from ..tools import fwhm_to_std
from ..types import (
AngularResolution,
QBins,
QData,
Expand All @@ -11,7 +12,6 @@
SampleSizeResolution,
WavelengthResolution,
)
from .tools import fwhm_to_std


def wavelength_resolution(da: QData[Sample]) -> WavelengthResolution:
Expand Down
2 changes: 1 addition & 1 deletion src/essreflectometry/amor/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sciline
import scipp as sc

from ..reflectometry.types import Run
from ..types import Run

# TODO What do they mean?
# Supermirror parameters
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import scipp as sc

from ..amor.tools import fwhm_to_std
from .tools import fwhm_to_std

# from . import orso
from .types import (
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 0 additions & 14 deletions src/essreflectometry/reflectometry/__init__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/amor/tools_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
import scipp as sc

from essreflectometry.amor import tools
from essreflectometry import tools


def test_linlogspace_linear():
Expand Down

0 comments on commit f6b242a

Please sign in to comment.