Skip to content
Snippets Groups Projects
Commit a0a23105 authored by Joshua Steer's avatar Joshua Steer
Browse files

Merge branch 'master' of https://git.soton.ac.uk/js22g12/AmpScan

parents 694fa941 0635cd36
No related branches found
No related tags found
No related merge requests found
Pipeline #318 passed
......@@ -328,8 +328,11 @@ class AmpObject(trimMixin, smoothMixin, analyseMixin, visMixin):
>>> ang = [np.pi/2, -np.pi/4, np.pi/3]
>>> amp.rotateAng(ang, ang='rad')
"""
if type(rot)==type([]):
R = self.rotMatrix(rot, ang)
self.rotate(R, norms)
else:
raise TypeError("rotateAng requires a list")
def rotate(self, R, norms=True):
......
.. image:: AmpScanlogo.svg
:width: 30%
:align: center
......@@ -21,27 +20,51 @@ developing AmpScan.
.. _VTK: https://www.vtk.org/
Installation
------------
Installing with Conda (Recommended)
-----------------------------------
AmpScan has a number of dependencies, we recommend using conda to deal with these. To create a new
environment to run AmpScan in:
AmpScan has a number of dependencies, namely; NumPy, SciPy, Matplotlib, PyQt and vtk. We recommend using
conda to deal with these. Before installation, ensure your environment is using Python 3. Verify that
you are running the latest version of pip:
``conda create -n env_name python=3 numpy scipy pyqt matplotlib``
``python -m pip install --upgrade pip``
``conda install -c conda-forge vtk=8.1.0``
Install dependencies using conda:
For the most up to date version of AmpScan, clone directly from the gitlab repository into a virtual environment using:
``conda install numpy scipy pyqt matplotlib vtk==8.1.0``
``git clone https://git.soton.ac.uk/js22g12/AmpScan.git``
Install AmpScan using pip:
Navigate to the `AmpScan/` directory and run a pip editable install using:
``pip install AmpScan``
``pip install -e .``
A pip installation is also available through test PyPI (not latest version) using:
Installing with Pip
-------------------
AmpScan has a number of dependencies, namely; NumPy, SciPy, Matplotlib, PyQt and vtk. Before
installing, ensure you have the latest version of pip:
``python -m pip install --upgrade pip``
Then install the dependencies using:
``pip install numpy matplotlib scipy pyqt5 vtk==8.1.0``
You can then install AmpScan from test PyPI using:
``$ pip install --index-url https://test.pypi.org/simple/ AmpScan``
``pip install AmpScan``
Developer Install
-----------------
For the most up to date version of AmpScan, clone directly from the gitlab repository using:
``git clone https://git.soton.ac.uk/js22g12/AmpScan.git``
Navigate to the `AmpScan/` directory and run a pip install using:
``pip install -e .``
Getting Started
......
......@@ -21,20 +21,24 @@ class TestBasicFunction(unittest.TestCase):
s = str(type(vtk))
self.assertEqual(s, "<class 'module'>")
s = str(type(AmpScan.core))
self.assertEqual(s, "<class 'module'>")
self.assertEqual(s, "<class 'module'>", "Failed import: AmpScan.core")
@unittest.expectedFailure
def test_failure(self):
s = str(type("string"))
self.assertEqual(s, "<class 'module'>")
# def test_import_stl(self):
# modPath = os.path.abspath(os.getcwd())
# sys.path.insert(0, modPath)
# stlPath = os.path.abspath(os.getcwd()) + "\\tests\\sample_stl_sphere_ASCII.stl"
# from AmpScan.core import AmpObject
# Amp = AmpObject(stlPath)
# self.assertRaises(MemoryError)
def test_import_stl(self):
modPath = os.path.abspath(os.getcwd())
sys.path.insert(0, modPath)
stlPath = os.path.abspath(os.getcwd()) + "\\tests\\sample_stl_sphere_BIN.stl"
from AmpScan.core import AmpObject
Amp = AmpObject(stlPath)
s = str(type(Amp))
self.assertEqual(s, "<class 'AmpScan.core.AmpObject'>", "Not expected Object")
with self.assertRaises(TypeError):
Amp.rotateAng(7)
Amp.rotateAng({})
if __name__ == '__main__':
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment