Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Install Python packages
run: |
pip install pytest==3.10.1; pip install pytest-xdist==1.26.1; pip install scipy==1.2.1; pip install nose==1.3.7
pip install pytest==3.10.1; pip install pytest-xdist==1.26.1; pip install scipy==1.2.1; pip install nose==1.3.7; pip install mock==3.0.5
echo "PYTEST=pytest -W ignore::PendingDeprecationWarning" >> $GITHUB_ENV
if: matrix.flavour == 'python'

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
SixCircleGeometry, Fivec, Fourc
from diffcalc.hardware import DummyHardwareAdapter
from diffcalc.hardware import ScannableHardwareAdapter
from test.tools import aneq_, mneq_
from diffcalc.tests.tools import aneq_, mneq_
from diffcalc.ub.persistence import UbCalculationNonPersister
from diffcalc.util import DiffcalcException, MockRawInput
from test.diffcalc import scenarios
from diffcalc.tests import scenarios
import diffcalc.util # @UnusedImport to overide raw_input
from diffcalc.gdasupport.minigda.command import sim

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from numpy import matrix
except ImportError:
from numjy import matrix
from test.tools import mneq_, aneq_, assert_dict_almost_equal
from diffcalc.tests.tools import mneq_, aneq_, assert_dict_almost_equal

import diffcalc.util # @UnusedImport
from diffcalc.hardware import DummyHardwareAdapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numpy import matrix
except ImportError:
from numjy import matrix
from test.tools import mneq_, aneq_, dneq_
from diffcalc.tests.tools import mneq_, aneq_, dneq_

import diffcalc.util # @UnusedImport
from diffcalc.hardware import DummyHardwareAdapter
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from diffcalc.gdasupport.scannable.diffractometer import \
DiffractometerScannableGroup
from diffcalc.gdasupport.scannable.mock import MockMotor
from test.diffcalc.gdasupport.scannable.mockdiffcalc import MockDiffcalc
from diffcalc.tests.gdasupport.scannable.mockdiffcalc import MockDiffcalc
try:
from gdascripts.pd.dummy_pds import DummyPD # @UnusedImport
except ImportError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from diffcalc.gdasupport.scannable.diffractometer import \
DiffractometerScannableGroup
from diffcalc.gdasupport.scannable.hkl import Hkl
from test.diffcalc.gdasupport.scannable.mockdiffcalc import MockDiffcalc
from diffcalc.tests.gdasupport.scannable.mockdiffcalc import MockDiffcalc
import pytest
try:
from gda.device.scannable.scannablegroup import ScannableGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from diffcalc.gdasupport.scannable.parameter import \
DiffractionCalculatorParameter
from test.diffcalc.gdasupport.scannable.mockdiffcalc import \
from diffcalc.tests.gdasupport.scannable.mockdiffcalc import \
MockParameterManager


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Gaussian
from diffcalc.hkl.vlieg.geometry import Fourc
from diffcalc.util import nearlyEqual
from test.tools import mneq_
from diffcalc.tests.tools import mneq_


class MockScannable(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from numjy import matrix

import diffcalc.gdasupport.minigda.command
from test.tools import mneq_
from diffcalc.tests.tools import mneq_

from diffcalc import settings
import diffcalc.hkl.you.calc
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import unittest
from math import pi
from mock import Mock
from test.tools import mneq_
from diffcalc.tests.tools import mneq_
import pytest
from diffcalc import settings

Expand All @@ -35,7 +35,7 @@
_findOmegaAndChiToRotateHchiIntoQalpha, check
from diffcalc.hkl.vlieg.geometry import createVliegMatrices
from diffcalc.util import DiffcalcException
from test.diffcalc import scenarios
from diffcalc.tests import scenarios

TORAD = pi / 180
TODEG = 180 / pi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from diffcalc.hkl.vlieg.constraints import ModeSelector, VliegParameterManager
from diffcalc.util import DiffcalcException
from test.diffcalc.hkl.vlieg.test_calc import \
from diffcalc.tests.hkl.vlieg.test_calc import \
createMockHardwareMonitor, createMockDiffractometerGeometry
import pytest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
except ImportError:
from numjy import matrix
from numjy.linalg import norm
from test.tools import mneq_
from diffcalc.tests.tools import mneq_


from diffcalc.hkl.vlieg.geometry import SixCircleGammaOnArmGeometry, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
from diffcalc.hkl.willmott.calc import \
WillmottHorizontalUbCalcStrategy, WillmottHorizontalCalculator, \
WillmottHorizontalPosition as Pos, WillmottHorizontalGeometry
from test.tools import assert_array_almost_equal, \
from diffcalc.tests.tools import assert_array_almost_equal, \
assert_second_dict_almost_in_first, matrixeq_
from diffcalc.ub.calc import UBCalculation
from diffcalc.ub.crystal import CrystalUnderTest
from diffcalc.ub.persistence import UbCalculationNonPersister
from diffcalc.util import DiffcalcException
from test.diffcalc.test_hardware import SimpleHardwareAdapter
from test.diffcalc.hkl.vlieg.test_calc import createMockUbcalc, \
from diffcalc.tests.test_hardware import SimpleHardwareAdapter
from diffcalc.tests.hkl.vlieg.test_calc import createMockUbcalc, \
createMockDiffractometerGeometry
import diffcalc.hkl.willmott.calc # @UnusedImport

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from diffcalc.hardware import DummyHardwareAdapter
from diffcalc.hkl.you.calc import YouHklCalculator
from diffcalc.hkl.you.constraints import YouConstraintManager
from test.tools import assert_array_almost_equal, \
from diffcalc.tests.tools import assert_array_almost_equal, \
assert_second_dict_almost_in_first, arrayeq_
from diffcalc.ub.crystal import CrystalUnderTest
from diffcalc.util import y_rotation, z_rotation, DiffcalcException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@

from diffcalc.hkl.you.calc import YouHklCalculator, I, \
_calc_angle_between_naz_and_qaz
from test.tools import assert_array_almost_equal, \
from diffcalc.tests.tools import assert_array_almost_equal, \
assert_matrix_almost_equal
from diffcalc.hkl.you.geometry import YouPosition, SixCircle

from test.diffcalc.hkl.you.test_calc import createMockHardwareMonitor, createMockUbcalc
from diffcalc.tests.hkl.you.test_calc import createMockHardwareMonitor, createMockUbcalc
from diffcalc.util import DiffcalcException

from diffcalc.settings import NUNAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
WillmottHorizontalPosition as WillPos
from diffcalc.hkl.you.geometry import YouPosition as YouPos
from diffcalc.hkl.you.calc import YouUbCalcStrategy
from test.tools import matrixeq_
from diffcalc.tests.tools import matrixeq_
from diffcalc.ub.calc import UBCalculation
from diffcalc.ub.crystal import CrystalUnderTest
from diffcalc.ub.persistence import UbCalculationNonPersister
from test.diffcalc.hkl.you.test_calc import _BaseTest
from diffcalc.tests.hkl.you.test_calc import _BaseTest
from diffcalc.settings import NUNAME

TORAD = pi / 180
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from diffcalc import settings

import diffcalc
from test.diffcalc.test_hardware import SimpleHardwareAdapter
from diffcalc.tests.test_hardware import SimpleHardwareAdapter
from diffcalc.hkl.you.geometry import SixCircle
diffcalc.util.DEBUG = True

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from diffcalc.hardware import HardwareAdapter
from diffcalc.hardware import ScannableHardwareAdapter
from nose.tools import eq_, assert_raises # @UnresolvedImport
from test.diffcalc.gdasupport.scannable.mockdiffcalc import MockDiffcalc
from diffcalc.tests.gdasupport.scannable.mockdiffcalc import MockDiffcalc


class SimpleHardwareAdapter(HardwareAdapter):
Expand Down
2 changes: 1 addition & 1 deletion test/test_numjy.py → diffcalc/tests/test_numjy.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
except ImportError:
__NUMJY_AVAILABLE__ = False

from test.tools import assert_2darray_almost_equal, meq_
from diffcalc.tests.tools import assert_2darray_almost_equal, meq_


class _TestNumpyMatrix():
Expand Down
2 changes: 1 addition & 1 deletion test/test_tools.py → diffcalc/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with Diffcalc. If not, see <http://www.gnu.org/licenses/>.
###

from test.tools import assert_almost_equal, assert_array_almost_equal, \
from diffcalc.tests.tools import assert_almost_equal, assert_array_almost_equal, \
assert_2darray_almost_equal, assert_matrix_almost_equal, \
assert_dict_almost_equal
from nose.tools import eq_ # @UnresolvedImport
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from math import pi, sqrt, atan2
from mock import Mock
from nose.tools import eq_
from test.tools import matrixeq_
from diffcalc.tests.tools import matrixeq_
import tempfile
import datetime
from diffcalc.util import TORAD, x_rotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@

from diffcalc.hkl.vlieg.geometry import SixCircleGammaOnArmGeometry
from diffcalc.hkl.vlieg.geometry import VliegPosition as Pos
from test.tools import matrixeq_, mneq_
from diffcalc.tests.tools import matrixeq_, mneq_
from diffcalc.ub.calc import UBCalculation
from diffcalc.ub.persistence import UbCalculationNonPersister
from diffcalc.util import DiffcalcException
from diffcalc.hkl.vlieg.calc import VliegUbCalcStrategy
from test.diffcalc import scenarios
from diffcalc.tests import scenarios

I = matrix('1 0 0; 0 1 0; 0 0 1')
TORAD = pi / 180
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from diffcalc.hkl.you.geometry import SixCircle
from diffcalc.hkl.you.geometry import YouPosition
from diffcalc.hkl.you.calc import YouUbCalcStrategy
from test.tools import matrixeq_
from diffcalc.tests.tools import matrixeq_
from diffcalc.ub.calc import UBCalculation
from diffcalc.ub.persistence import UbCalculationNonPersister

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
except ImportError:
from numjy import matrix

from test.tools import assert_dict_almost_equal, mneq_
from diffcalc.tests.tools import assert_dict_almost_equal, mneq_
from diffcalc.ub.crystal import CrystalUnderTest
from test.diffcalc import scenarios
from diffcalc.tests import scenarios


class TestCrystalUnderTest(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from mock import Mock
from diffcalc.ub.reference import YouReference
from test.tools import assert_array_almost_equal, assert_2darray_almost_equal
from diffcalc.tests.tools import assert_array_almost_equal, assert_2darray_almost_equal

try:
from numpy import matrix, hstack
Expand Down
6 changes: 3 additions & 3 deletions test/diffcalc/ub/test_ub.py → diffcalc/tests/ub/test_ub.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
VliegPosition
from diffcalc.hkl.you.geometry import SixCircle
from diffcalc.hardware import DummyHardwareAdapter
from test.tools import assert_iterable_almost_equal, mneq_, arrayeq_
from diffcalc.tests.tools import assert_iterable_almost_equal, mneq_, arrayeq_
from diffcalc.ub.persistence import UbCalculationNonPersister,\
UBCalculationJSONPersister
from diffcalc.ub.calcstate import UBCalcStateEncoder
from diffcalc.util import DiffcalcException, MockRawInput, xyz_rotation,\
TODEG, TORAD, CoordinateConverter
from diffcalc.hkl.vlieg.calc import VliegUbCalcStrategy, vliegAnglesToHkl
from diffcalc.hkl.you.calc import youAnglesToHkl, YouUbCalcStrategy
from test.diffcalc import scenarios
from test.diffcalc.scenarios import YouPositionScenario
from diffcalc.tests import scenarios
from diffcalc.tests.scenarios import YouPositionScenario


diffcalc.util.DEBUG = True
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions install-jython-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ wget https://files.pythonhosted.org/packages/3e/89/7ea760b4daa42653ece2380531c90
wget https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl
wget https://files.pythonhosted.org/packages/a4/a6/42f17d065bda1fac255db13afc94c93dbfb64393eae37c749b4cb0752fc7/more_itertools-5.0.0-py3-none-any.whl
wget https://files.pythonhosted.org/packages/99/4f/13fb671119e65c4dce97c60e67d3fd9e6f7f809f2b307e2611f4701205cb/nose-1.3.7-py2-none-any.whl
wget https://files.pythonhosted.org/packages/59/83/8fcdcf4babcc55290e50cbd54fcc9fcdd81c2e62eff27c1e6a2f23d79381/mock-3.0.0-py2.py3-none-any.whl

unzip -d $HOME/jython/Lib/site-packages Pygments-2.2.0-py2.py3-none-any.whl
unzip -d $HOME/jython/Lib/site-packages decorator-4.1.2-py2.py3-none-any.whl
Expand All @@ -61,3 +62,5 @@ unzip -d $HOME/jython/Lib/site-packages packaging-20.9-py2.py3-none-any.whl
unzip -d $HOME/jython/Lib/site-packages funcsigs-1.0.2-py2.py3-none-any.whl
unzip -d $HOME/jython/Lib/site-packages more_itertools-5.0.0-py3-none-any.whl
unzip -d $HOME/jython/Lib/site-packages nose-1.3.7-py2-none-any.whl
unzip -d $HOME/jython/Lib/site-packages mock-3.0.0-py2.py3-none-any.whl

Loading