Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs #14

Closed
wants to merge 14 commits into from
21 changes: 21 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/source/conf.py

formats:
- pdf
- epub

python:
install:
- method: pip
path: .
extra_requirements:
- docs
- requirements: docs/requirements.txt
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpydoc
mpl-sphinx-theme
10 changes: 8 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Andrew Mounce'

# The full version, including alpha/beta/rc tags
release = '0.0.0'
release = '0.0.1'

# -- General configuration ---------------------------------------------------

Expand All @@ -32,11 +32,17 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'numpydoc']
# 'numpydoc',
'sphinx.ext.napoleon',]

# napoleon options
napoleon_numpy_docstring = True

# numpydoc options
numpydoc_show_inherited_class_members = False
numpydoc_class_members_toctree = False

# autodoc options
autodoc_typehints = "none"
autodoc_docstring_signature = True
autodoc_default_options = {'members': None}
Expand Down
11 changes: 11 additions & 0 deletions pyscan/drivers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,19 @@
from .yokogawags200 import YokogawaGS200
from .actonsp2300 import ActonSP2300

try:
from .attocubeANC350 import AttocubeANC350
except ModuleNotFoundError:
print('pylablib not found, AttocubeANC350 not loaded')

try:
from .baslercamera import BaslerCamera
except ModuleNotFoundError:
print('Basler Camera software not found, BaserCamera not loaded')

try:
from .helioscamera import HeliosCamera

except ModuleNotFoundError:
print('Helios Camera not installed')

Expand Down
88 changes: 88 additions & 0 deletions pyscan/drivers/attocubeANC350.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
from pylablib.devices.Attocube.anc350 import ANC350
from pyscan.general.itemattribute import ItemAttribute
from .instrumentdriver import InstrumentDriver

class AttocubeANC350(InstrumentDriver): #deleted ANC350

def __init__(self, instrument):

super().__init__(instrument)

self.inst = ANC350()
#self.debug = False
#self.initialize_properties()

# setattr(self.__class__, 'x', property(lambda self: self.get_x(), lambda self, new_value: self.set_x(new_value)))
# setattr(self.__class__, 'y', property(lambda self: self.get_y(), lambda self, new_value: self.set_y(new_value)))
# setattr(self.__class__, 'z', property(lambda self: self.get_z(), lambda self, new_value: self.set_z(new_value)))

def get_x(self):
self._x = self.inst.get_position(0)
return self._x

def set_x(self, new_value):
xmin = 1e-3
xmax = 4.8e-3
if (new_value < xmax) & (new_value > xmin):
self.inst.move_to(0, new_value)
self._x = 0
else:
print('x out of range')

def get_y(self):
self._y = self.inst.get_position(1)
return self._y

def set_y(self, new_value):
ymin = 1e-3
ymax = 4.8e-3
if (new_value < ymax) & (new_value > ymin):
self.inst.move_to(1, new_value)
self._y = 0
else:
print('y out of range')

def get_z(self):
self._z = self.inst.get_position(2)
return self._z

def set_z(self, new_value):
zmin = 0.6e-3
zmax = 1e-3
if (new_value < zmax) & (new_value > zmin):
self.inst.move_to(2, new_value)
self._z = 0
else:
print('z out of range')

@property
def x(self):
return self.get_x()

@x.setter
def x(self, new_value):
return self.set_x(new_value)

@property
def y(self):
return self.get_y()

@y.setter
def y(self, new_value):
return self.set_y(new_value)

@property
def z(self):
return self.get_z()

@z.setter
def z(self, new_value):
return self.set_z(new_value)

@property
def xyz(self):
return [self.get_x(), self.get_y(), self.get_z()]

@xyz.setter
def xyz(self, new_value):
return self.set_x(new_value[0]), self.set_y(new_value[1]), self.set_z(new_value[2])
4 changes: 2 additions & 2 deletions pyscan/drivers/stanford396.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@


class Stanford396(InstrumentDriver):
'''Class to control Stanford Research SG396 Vector Signal Generator

'''Class to control Stanford Research SR396 Vector Signal Generator
Parameters
----------
instrument :
Expand Down
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ def read(fname):
instruments and run experements"""
),
license="MIT",
keywords="scientific instrument drivers measurement tools",
keywords = [
"scientific",
"instrument",
"drivers",
"measurement",
"experiment",
],
url="",
packages=find_packages(exclude=['docs']),
long_description=read('README.md'),
Expand All @@ -35,6 +41,11 @@ def read(fname):
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"License :: MIT",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Physics",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Unix"
],
python_requires='>=3.6',
)