Skip to content

Commit

Permalink
Make backend public
Browse files Browse the repository at this point in the history
  • Loading branch information
crnh committed Jul 17, 2024
1 parent 664e787 commit 0b2f26b
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions tests/analysis/test_analyses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import visisipy
import visisipy._backend
import visisipy.backend


class MockAnalysis:
Expand Down Expand Up @@ -33,7 +33,7 @@ class MockBackend:


def test_raytracing_analysis(monkeypatch):
monkeypatch.setattr(visisipy._backend, "_BACKEND", MockBackend)
monkeypatch.setattr(visisipy.backend, "_BACKEND", MockBackend)

assert visisipy.analysis.raytrace(coordinates=[(0, 0)]) is None
assert visisipy.analysis.raytrace(coordinates=[(0, 0)], return_raw_result=True) == (
Expand All @@ -43,7 +43,7 @@ def test_raytracing_analysis(monkeypatch):


def test_zernike_standard_coefficients_analysis(monkeypatch):
monkeypatch.setattr(visisipy._backend, "_BACKEND", MockBackend)
monkeypatch.setattr(visisipy.backend, "_BACKEND", MockBackend)

assert visisipy.analysis.zernike_standard_coefficients() is None
assert visisipy.analysis.zernike_standard_coefficients(return_raw_result=True) == (
Expand All @@ -53,7 +53,7 @@ def test_zernike_standard_coefficients_analysis(monkeypatch):


def test_refraction_analysis(monkeypatch):
monkeypatch.setattr(visisipy._backend, "_BACKEND", MockBackend)
monkeypatch.setattr(visisipy.backend, "_BACKEND", MockBackend)

assert visisipy.analysis.refraction() is None
assert visisipy.analysis.refraction(return_raw_result=True) == (None, None)
2 changes: 1 addition & 1 deletion visisipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from visisipy import analysis, models, opticstudio, plots
from visisipy._backend import get_backend, set_backend
from visisipy.backend import get_backend, set_backend
from visisipy.models import (
EyeGeometry,
EyeMaterials,
Expand Down
2 changes: 1 addition & 1 deletion visisipy/analysis.bak.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import numpy as np

from visisipy._backend import get_backend
from visisipy.backend import get_backend

if TYPE_CHECKING:
from pandas import DataFrame
Expand Down
2 changes: 1 addition & 1 deletion visisipy/analysis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import inspect
from functools import wraps

from visisipy._backend import get_backend
from visisipy.backend import get_backend

if TYPE_CHECKING:
from visisipy.models import EyeModel
Expand Down
2 changes: 1 addition & 1 deletion visisipy/analysis/raytracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Iterable, Literal, TYPE_CHECKING, Any

from visisipy._backend import get_backend
from visisipy.backend import get_backend

from visisipy.analysis.base import analysis

Expand Down
2 changes: 1 addition & 1 deletion visisipy/analysis/refraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, Literal, TYPE_CHECKING

from visisipy.analysis.base import analysis
from visisipy._backend import get_backend
from visisipy.backend import get_backend

if TYPE_CHECKING:
from visisipy import EyeModel
Expand Down
2 changes: 1 addition & 1 deletion visisipy/analysis/zernike_standard_coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Any, Literal, TYPE_CHECKING

from visisipy._backend import get_backend
from visisipy.backend import get_backend
from visisipy.analysis.base import analysis

if TYPE_CHECKING:
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion visisipy/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from os import PathLike
from typing import Any

from visisipy import _backend
from visisipy.models.geometry import EyeGeometry, NavarroGeometry, create_geometry
from visisipy.models.materials import EyeMaterials, NavarroMaterials

Expand Down
2 changes: 1 addition & 1 deletion visisipy/opticstudio/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import zospy as zp
from pandas import DataFrame

from visisipy._backend import BaseAnalysis
from visisipy.backend import BaseAnalysis
from visisipy.analysis.refraction import FourierPowerVectorRefraction

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion visisipy/opticstudio/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import zospy as zp
from zospy.zpcore import ZOS, OpticStudioSystem

from visisipy._backend import BaseBackend, _classproperty
from visisipy.backend import BaseBackend, _classproperty
from visisipy.opticstudio.analysis import OpticStudioAnalysis
from visisipy.opticstudio.models import BaseOpticStudioEye, OpticStudioEye

Expand Down

0 comments on commit 0b2f26b

Please sign in to comment.