Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
AmpScan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Joshua Steer
AmpScan
Commits
a0a23105
Commit
a0a23105
authored
6 years ago
by
Joshua Steer
Browse files
Options
Downloads
Plain Diff
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
6 years ago
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
AmpScan/core.py
+5
-2
5 additions, 2 deletions
AmpScan/core.py
docs/index.rst
+36
-13
36 additions, 13 deletions
docs/index.rst
tests/sample_test.py
+12
-8
12 additions, 8 deletions
tests/sample_test.py
with
53 additions
and
23 deletions
AmpScan/core.py
+
5
−
2
View file @
a0a23105
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
docs/index.rst
+
36
−
13
View file @
a0a23105
.. image:: AmpScanlogo.svg
:width: 30%
:align: center
...
...
@@ -21,27 +20,51 @@ developing AmpScan.
.. _VTK: https://www.vtk.org/
Install
ation
------------
Install
ing 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
...
...
This diff is collapsed.
Click to expand it.
tests/sample_test.py
+
12
−
8
View file @
a0a23105
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment