Skip to content

Commit 4c9ced5

Browse files
committed
Merge branch 'release/v1.8.2'
2 parents a6f2e2b + 294837f commit 4c9ced5

56 files changed

Lines changed: 1573 additions & 1316 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bumpversion.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[bumpversion]
2+
current_version = 1.8.2
3+
commit = False
4+
tag = False
5+
6+
[bumpversion:file:setup.py]
7+
search = current_version = "{current_version}"
8+
replace = current_version = "{new_version}"
9+
10+
[bumpversion:file:docs/source/conf.py]
11+
search = version = release = "{current_version}"
12+
replace = version = release = "{new_version}"
13+
14+
[bumpversion:file:pybpodapi/__init__.py]
15+
search = __version__ = "{current_version}"
16+
replace = __version__ = "{new_version}"
17+

docs/source/conf.py

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@
2424
import os
2525
import sys
2626

27-
#sys.path.insert(0, os.path.abspath('../../pybpodapi'))
28-
#sys.path.insert(0, os.path.abspath('../../'))
29-
30-
import pybpodapi
27+
# sys.path.insert(0, os.path.abspath('../../pybpodapi'))
28+
# sys.path.insert(0, os.path.abspath('../../'))
3129

3230
# adds support for Markwdown
3331
from recommonmark.parser import CommonMarkParser
32+
3433
source_parsers = {
35-
'.md': CommonMarkParser,
34+
".md": CommonMarkParser,
3635
}
3736

3837

@@ -46,45 +45,44 @@
4645
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4746
# ones.
4847
extensions = [
49-
'sphinx.ext.autodoc',
50-
'sphinx.ext.intersphinx',
51-
'sphinx.ext.todo',
52-
'sphinx.ext.viewcode',
53-
'sphinx.ext.inheritance_diagram']
48+
"sphinx.ext.autodoc",
49+
"sphinx.ext.intersphinx",
50+
"sphinx.ext.todo",
51+
"sphinx.ext.viewcode",
52+
"sphinx.ext.inheritance_diagram",
53+
]
5454

5555

56-
graphviz_output_format = 'svg'
56+
graphviz_output_format = "svg"
5757

5858
# Do not sort autodoc alphabetically, use source code appearance order.
59-
autodoc_member_order= 'bysource'
59+
autodoc_member_order = "bysource"
6060

6161
# Both the class’ and the __init__ method’s docstring are concatenated and inserted.
62-
autoclass_content = 'both'
62+
autoclass_content = "both"
6363

6464
# Add any paths that contain templates here, relative to this directory.
65-
templates_path = ['_templates']
65+
templates_path = ["_templates"]
6666

6767
# The suffix(es) of source filenames.
6868
# You can specify multiple suffix as a list of string:
6969
#
70-
source_suffix = ['.rst', '.md']
70+
source_suffix = [".rst", ".md"]
7171

7272
# The master toctree document.
73-
master_doc = 'index'
73+
master_doc = "index"
7474

7575
# General information about the project.
76-
project = 'pybpod-api'
77-
copyright = '2017-2019, CF Scientific Software Platform'
78-
author = 'Carlos Mão de Ferro'
76+
project = "pybpod-api"
77+
copyright = "2017-2019, Scientific Software Platform, Champalimaud Foundation"
78+
author = "Scientific Software Platform, Champalimaud Foundation"
7979

8080
# The version info for the project you're documenting, acts as replacement for
8181
# |version| and |release|, also used in various other places throughout the
8282
# built documents.
8383
#
8484
# The short X.Y version.
85-
version = pybpodapi.__version__
86-
# The full version, including alpha/beta/rc tags.
87-
release = pybpodapi.__version__
85+
version = release = "1.8.2"
8886

8987
# The language for content autogenerated by Sphinx. Refer to documentation
9088
# for a list of supported languages.
@@ -99,7 +97,7 @@
9997
exclude_patterns = []
10098

10199
# The name of the Pygments (syntax highlighting) style to use.
102-
pygments_style = 'default'
100+
pygments_style = "default"
103101

104102
# If true, `todo` and `todoList` produce output, else they produce nothing.
105103
todo_include_todos = True
@@ -110,7 +108,7 @@
110108
# The theme to use for HTML and HTML Help pages. See the documentation for
111109
# a list of builtin themes.
112110
#
113-
html_theme = 'sphinx_rtd_theme'
111+
html_theme = "sphinx_rtd_theme"
114112

115113
# Theme options are theme-specific and customize the look and feel of a theme
116114
# further. For a list of options available for each theme, see the
@@ -119,60 +117,59 @@
119117
# html_theme_options = {}
120118
# toc tree depth on sidebar
121119
html_theme_options = {
122-
'collapse_navigation': False,
123-
'display_version': True,
124-
'navigation_depth': 3
120+
"collapse_navigation": False,
121+
"display_version": True,
122+
"navigation_depth": 3,
125123
}
126124

127125
# Add any paths that contain custom static files (such as style sheets) here,
128126
# relative to this directory. They are copied after the builtin static files,
129127
# so a file named "default.css" will overwrite the builtin "default.css".
130-
html_static_path = ['_images']
128+
html_static_path = ["_images"]
131129

132130

133131
# -- Options for HTMLHelp output ------------------------------------------
134132

135133
# Output file base name for HTML help builder.
136-
htmlhelp_basename = 'pybpodapidoc'
134+
htmlhelp_basename = "pybpodapidoc"
137135

138136

139137
# -- Options for LaTeX output ---------------------------------------------
140138

141139
latex_elements = {
142-
# The paper size ('letterpaper' or 'a4paper').
143-
#
144-
# 'papersize': 'letterpaper',
145-
146-
# The font size ('10pt', '11pt' or '12pt').
147-
#
148-
# 'pointsize': '10pt',
149-
150-
# Additional stuff for the LaTeX preamble.
151-
#
152-
# 'preamble': '',
153-
154-
# Latex figure (float) alignment
155-
#
156-
# 'figure_align': 'htbp',
140+
# The paper size ('letterpaper' or 'a4paper').
141+
#
142+
# 'papersize': 'letterpaper',
143+
# The font size ('10pt', '11pt' or '12pt').
144+
#
145+
# 'pointsize': '10pt',
146+
# Additional stuff for the LaTeX preamble.
147+
#
148+
# 'preamble': '',
149+
# Latex figure (float) alignment
150+
#
151+
# 'figure_align': 'htbp',
157152
}
158153

159154
# Grouping the document tree into LaTeX files. List of tuples
160155
# (source start file, target name, title,
161156
# author, documentclass [howto, manual, or own class]).
162157
latex_documents = [
163-
(master_doc, 'pybpodapi.tex', 'pybpod-api Documentation',
164-
'Carlos Mão de Ferro', 'manual'),
158+
(
159+
master_doc,
160+
"pybpodapi.tex",
161+
"pybpod-api Documentation",
162+
"Carlos Mão de Ferro",
163+
"manual",
164+
),
165165
]
166166

167167

168168
# -- Options for manual page output ---------------------------------------
169169

170170
# One entry per manual page. List of tuples
171171
# (source start file, name, description, authors, manual section).
172-
man_pages = [
173-
(master_doc, 'pybpodapi', 'pybpod-api Documentation',
174-
[author], 1)
175-
]
172+
man_pages = [(master_doc, "pybpodapi", "pybpod-api Documentation", [author], 1)]
176173

177174

178175
# -- Options for Texinfo output -------------------------------------------
@@ -181,13 +178,18 @@
181178
# (source start file, target name, title, author,
182179
# dir menu entry, description, category)
183180
texinfo_documents = [
184-
(master_doc, 'pybpodapi', 'pybpod-api Documentation',
185-
author, 'pybpodapi', 'One line description of project.',
186-
'Miscellaneous'),
181+
(
182+
master_doc,
183+
"pybpodapi",
184+
"pybpod-api Documentation",
185+
author,
186+
"pybpodapi",
187+
"One line description of project.",
188+
"Miscellaneous",
189+
),
187190
]
188191

189192

190-
191193
# -- Options for Epub output ----------------------------------------------
192194

193195
# Bibliographic Dublin Core info.
@@ -206,9 +208,9 @@
206208
# epub_uid = ''
207209

208210
# A list of files that should not be packed into the epub file.
209-
epub_exclude_files = ['search.html']
210-
211+
epub_exclude_files = ["search.html"]
211212

212213

213214
# Example configuration for intersphinx: refer to the Python standard library.
214-
intersphinx_mapping = {'python': ('https://docs.python.org/3.5', None)}
215+
intersphinx_mapping = {"python": ("https://docs.python.org/3.5", None)}
216+

pybpodapi/__init__.py

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,45 @@
33
from confapp import conf
44
import loggingbootstrap
55

6-
__version__ = "1.8.1"
7-
__author__ = ['Ricardo Ribeiro', 'Carlos Mão de Ferro', 'Joshua Sanders', 'Luís Teixeira']
8-
__credits__ = ["Ricardo Ribeiro", "Carlos Mao de Ferro", 'Luís Teixeira']
6+
__version__ = "1.8.2"
7+
__author__ = [
8+
"Ricardo Ribeiro",
9+
"Carlos Mão de Ferro",
10+
"Joshua Sanders",
11+
"Luís Teixeira",
12+
]
13+
__credits__ = ["Ricardo Ribeiro", "Carlos Mao de Ferro", "Luís Teixeira"]
914
__license__ = "MIT"
10-
__maintainer__ = ['Ricardo Ribeiro', 'Carlos Mão de Ferro', 'Joshua Sanders', 'Luís Teixeira']
11-
__email__ = ['ricardojvr@gmail.com', 'cajomferro@gmail.com', 'joshua21@gmail.com', 'micboucinha@gmail.com']
15+
__maintainer__ = [
16+
"Ricardo Ribeiro",
17+
"Carlos Mão de Ferro",
18+
"Joshua Sanders",
19+
"Luís Teixeira",
20+
]
21+
__email__ = [
22+
"ricardojvr@gmail.com",
23+
"cajomferro@gmail.com",
24+
"joshua21@gmail.com",
25+
"micboucinha@gmail.com",
26+
]
1227
__status__ = "Development"
1328

1429

1530
# load the user settings
1631
try:
1732
import user_settings
33+
1834
conf += user_settings
1935
except:
2036
pass
2137

22-
conf += 'pybpodapi.settings'
38+
conf += "pybpodapi.settings"
2339

2440
if conf.PYBPOD_API_LOG_LEVEL is not None:
2541
# setup different loggers for example script and api
26-
loggingbootstrap.create_double_logger("pybpodapi",
27-
conf.PYBPOD_API_LOG_LEVEL,
28-
conf.PYBPOD_API_LOG_FILE,
29-
conf.PYBPOD_API_LOG_LEVEL)
42+
loggingbootstrap.create_double_logger(
43+
"pybpodapi",
44+
conf.PYBPOD_API_LOG_LEVEL,
45+
conf.PYBPOD_API_LOG_FILE,
46+
conf.PYBPOD_API_LOG_LEVEL,
47+
)

pybpodapi/bpod/bpod_base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def send_state_machine(self, sma, run_asap=None):
234234

235235
state_machine_body = sma.build_message() + sma.build_message_global_timer() + sma.build_message_32_bits()
236236

237-
self._bpodcom_send_state_machine( sma.build_header(run_asap, len(state_machine_body)) + state_machine_body)
237+
self._bpodcom_send_state_machine(sma.build_header(run_asap, len(state_machine_body)) + state_machine_body)
238238

239239
self._new_sma_sent = True
240240

@@ -332,10 +332,7 @@ def run_state_machine(self, sma):
332332
self.close()
333333
exit(0)
334334

335-
if interrupt_task:
336-
return False
337-
338-
return True
335+
return not interrupt_task
339336

340337
def handle_inline(self, inline, sma):
341338
interrupt_task = False
@@ -425,7 +422,7 @@ def trigger_input(self, channel_number, value):
425422
def trigger_output(self, channel_number, value):
426423
return self._bpodcom_override_digital_hardware_state(channel_number, value)
427424

428-
def trigger_softcode(self, softcode):
425+
def trigger_softcode(self, softcode):
429426
return self._bpodcom_send_softcode(softcode)
430427

431428
def load_message(self, module_index, msg):

pybpodapi/bpod/bpod_com_protocol.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ def _bpodcom_enable_ports(self, hardware):
252252

253253
###### set inputs enabled or disabled #######################################################
254254
hardware.inputs_enabled = [0] * len(hardware.inputs)
255-
ports_found = False
256255

257256
for j, i in enumerate(hardware.bnc_inputports_indexes):
258257
hardware.inputs_enabled[i] = settings.BPOD_BNC_PORTS_ENABLED[j]
@@ -615,6 +614,6 @@ def modules(self):
615614
# return BpodBase.machine_type.fget(self)
616615

617616
# @property
618-
# def cycle_frequency(self):
617+
# def cycle_frequency(self):
619618
# self.__bpodcom_check_com_ready()
620619
# return BpodBase.cycle_frequency.fget(self)

0 commit comments

Comments
 (0)