Skip to content

Commit d2e8d37

Browse files
committed
Changes from code inspection with PyCharm
1 parent cb43a76 commit d2e8d37

23 files changed

Lines changed: 123 additions & 671 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,22 @@
11

2-
PrivateRules.mak
32
/.idea
4-
/examples/**/*.rst
5-
/examples/**/*.html
6-
/examples/**/*.fits
7-
/examples/arl/*.png
83
/examples/experiments
94

10-
*.pyc
11-
*.o
12-
135
/docs/build
146
.ipynb_checkpoints
157

16-
examples/performance/*
17-
18-
workflows/ffiwrapped/ical_starpu/ical_starpu
19-
workflows/ffiwrapped/ical_starpu/ical_starpu_implicit
20-
21-
__pycache__
228
.cache
23-
/results
249
/workspace
25-
/tests/unittest_results
26-
27-
/examples/ffi_demo/ffi_demo
28-
/examples/ffi_demo/build
29-
/examples/result
30-
/venv-patched
31-
32-
/build
3310
/algorithm_reference_library.egg-info/
3411

35-
**/*.class
3612
dask-worker-space
37-
/docs/libs
3813
/docs/processing_components
3914
/docs/workflows
4015
*/notebooks/*_files
4116
*/notebooks/*.rst
4217
*.log
4318
*.fits
44-
/coverage
45-
*.hdf
46-
.coverage.*
47-
.coverage
48-
dask-work-space
49-
50-
*~
51-
.DS_Store
52-
**/.DS_Store
5319
*.lock
5420
*.hdf5
55-
*.jpg
21+
*.pyc
22+
/build

‎docker/jupyter_notebook_config.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
from jupyter_core.paths import jupyter_data_dir
88
from notebook.auth import passwd
99

10+
# Add global to quiet error checking but I suspect that this file is defunct
11+
global c
12+
1013
# Setup the Notebook to listen on all interfaces on port 8888 by default
1114
c.NotebookApp.ip = '*'
1215
c.NotebookApp.port = 8888

‎docs/conf.py‎

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# -- General configuration ------------------------------------------------
2525

2626
# If your documentation needs a minimal Sphinx version, state it here.
27-
#needs_sphinx = '1.0'
27+
# needs_sphinx = '1.0'
2828

2929
# Add any Sphinx extension module names here, as strings. They can be
3030
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -47,7 +47,7 @@
4747
source_suffix = '.rst'
4848

4949
# The encoding of source files.
50-
#source_encoding = 'utf-8-sig'
50+
# source_encoding = 'utf-8-sig'
5151

5252
# The master toctree document.
5353
master_doc = 'index'
@@ -75,9 +75,9 @@
7575

7676
# There are two options for replacing |today|: either, you set today to some
7777
# non-false value, then it is used:
78-
#today = ''
78+
# today = ''
7979
# Else, today_fmt is used as the format for a strftime call.
80-
#today_fmt = '%B %d, %Y'
80+
# today_fmt = '%B %d, %Y'
8181

8282
# List of patterns, relative to source directory, that match files and
8383
# directories to ignore when looking for source files.
@@ -86,7 +86,7 @@
8686

8787
# The reST default role (used for this markup: `text`) to use for all
8888
# documents.
89-
#default_role = None
89+
# default_role = None
9090

9191
# If true, '()' will be appended to :func: etc. cross-reference text.
9292
add_function_parentheses = True
@@ -97,51 +97,50 @@
9797

9898
# If true, sectionauthor and moduleauthor directives will be shown in the
9999
# output. They are ignored by default.
100-
#show_authors = False
100+
# show_authors = False
101101

102102
# The name of the Pygments (syntax highlighting) style to use.
103103
pygments_style = 'sphinx'
104104

105105
# A list of ignored prefixes for module index sorting.
106-
#modindex_common_prefix = []
106+
# modindex_common_prefix = []
107107

108108
# If true, keep warnings as "system message" paragraphs in the built documents.
109-
#keep_warnings = False
109+
# keep_warnings = False
110110

111111
# If true, `todo` and `todoList` produce output, else they produce nothing.
112112
todo_include_todos = True
113113

114-
115114
# -- Options for HTML output ----------------------------------------------
116115

117116
# The theme to use for HTML and HTML Help pages. See the documentation for
118117
# a list of builtin themes.
119-
#html_theme = 'default'
118+
# html_theme = 'default'
120119
html_theme = 'sphinx_rtd_theme'
121120

122121
# Theme options are theme-specific and customize the look and feel of a theme
123122
# further. For a list of options available for each theme, see the
124123
# documentation.
125-
#html_theme_options = {}
124+
# html_theme_options = {}
126125

127126
# Add any paths that contain custom themes here, relative to this directory.
128-
#html_theme_path = []
127+
# html_theme_path = []
129128

130129
# The name for this set of Sphinx documents.
131130
# "<project> v<release> documentation" by default.
132-
#html_title = 'crocodile v0.1'
131+
# html_title = 'crocodile v0.1'
133132

134133
# A shorter title for the navigation bar. Default is the same as html_title.
135-
#html_short_title = None
134+
# html_short_title = None
136135

137136
# The name of an image file (relative to this directory) to place at the top
138137
# of the sidebar.
139-
#html_logo = None
138+
# html_logo = None
140139

141140
# The name of an image file (relative to this directory) to use as a favicon of
142141
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
143142
# pixels large.
144-
#html_favicon = None
143+
# html_favicon = None
145144

146145
# Add any paths that contain custom static files (such as style sheets) here,
147146
# relative to this directory. They are copied after the builtin static files,
@@ -151,7 +150,7 @@
151150
# Add any extra paths that contain custom files (such as robots.txt or
152151
# .htaccess) here, relative to this directory. These files are copied
153152
# directly to the root of the documentation.
154-
#html_extra_path = []
153+
# html_extra_path = []
155154

156155
# If not None, a 'Last updated on:' timestamp is inserted at every page
157156
# bottom, using the given strftime format.
@@ -160,14 +159,14 @@
160159

161160
# If true, SmartyPants will be used to convert quotes and dashes to
162161
# typographically correct entities.
163-
#html_use_smartypants = True
162+
# html_use_smartypants = True
164163

165164
# Custom sidebar templates, maps document names to template names.
166-
#html_sidebars = {}
165+
# html_sidebars = {}
167166

168167
# Additional templates that should be rendered to pages, maps page names to
169168
# template names.
170-
#html_additional_pages = {}
169+
# html_additional_pages = {}
171170

172171
# If false, no module index is generated.
173172
html_domain_indices = True
@@ -176,57 +175,57 @@
176175
html_use_index = True
177176

178177
# If true, the index is split into individual pages for each letter.
179-
#html_split_index = False
178+
# html_split_index = False
180179

181180
# If true, links to the reST sources are added to the pages.
182-
#html_show_sourcelink = True
181+
# html_show_sourcelink = True
183182

184183
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
185-
#html_show_sphinx = True
184+
# html_show_sphinx = True
186185

187186
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
188-
#html_show_copyright = True
187+
# html_show_copyright = True
189188

190189
# If true, an OpenSearch description file will be output, and all pages will
191190
# contain a <link> tag referring to it. The value of this option must be the
192191
# base URL from which the finished HTML is served.
193-
#html_use_opensearch = ''
192+
# html_use_opensearch = ''
194193

195194
# This is the file name suffix for HTML files (e.g. ".xhtml").
196-
#html_file_suffix = None
195+
# html_file_suffix = None
197196

198197
# Language to be used for generating the HTML full-text search index.
199198
# Sphinx supports the following languages:
200199
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
201200
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
202-
#html_search_language = 'en'
201+
# html_search_language = 'en'
203202

204203
# A dictionary with options for the search language support, empty by default.
205204
# 'ja' uses this config value.
206205
# 'zh' user can custom change `jieba` dictionary path.
207-
#html_search_options = {'type': 'default'}
206+
# html_search_options = {'type': 'default'}
208207

209208
# The name of a javascript file (relative to the configuration directory) that
210209
# implements a search results scorer. If empty, the default will be used.
211-
#html_search_scorer = 'scorer.js'
210+
# html_search_scorer = 'scorer.js'
212211

213212
# Output file base name for HTML help builder.
214213
htmlhelp_basename = 'arldoc'
215214

216215
# -- Options for LaTeX output ---------------------------------------------
217216

218217
latex_elements = {
219-
# The paper size ('letterpaper' or 'a4paper').
220-
#'papersize': 'letterpaper',
221-
222-
# The font size ('10pt', '11pt' or '12pt').
223-
#'pointsize': '10pt',
224-
225-
# Additional stuff for the LaTeX preamble.
226-
#'preamble': '',
227-
228-
# Latex figure (float) alignment
229-
#'figure_align': 'htbp',
218+
# The paper size ('letterpaper' or 'a4paper').
219+
# 'papersize': 'letterpaper',
220+
221+
# The font size ('10pt', '11pt' or '12pt').
222+
# 'pointsize': '10pt',
223+
224+
# Additional stuff for the LaTeX preamble.
225+
# 'preamble': '',
226+
227+
# Latex figure (float) alignment
228+
# 'figure_align': 'htbp',
230229
}
231230

232231
# Grouping the document tree into LaTeX files. List of tuples
@@ -239,23 +238,23 @@
239238

240239
# The name of an image file (relative to this directory) to place at the top of
241240
# the title page.
242-
#latex_logo = None
241+
# latex_logo = None
243242

244243
# For "manual" documents, if this is true, then toplevel headings are parts,
245244
# not chapters.
246-
#latex_use_parts = False
245+
# latex_use_parts = False
247246

248247
# If true, show page references after internal links.
249-
#latex_show_pagerefs = False
248+
# latex_show_pagerefs = False
250249

251250
# If true, show URL addresses after external links.
252-
#latex_show_urls = False
251+
# latex_show_urls = False
253252

254253
# Documents to append as an appendix to all manuals.
255-
#latex_appendices = []
254+
# latex_appendices = []
256255

257256
# If false, no module index is generated.
258-
#latex_domain_indices = True
257+
# latex_domain_indices = True
259258

260259

261260
# -- Options for manual page output ---------------------------------------
@@ -268,7 +267,7 @@
268267
]
269268

270269
# If true, show URL addresses after external links.
271-
#man_show_urls = False
270+
# man_show_urls = False
272271

273272

274273
# -- Options for Texinfo output -------------------------------------------
@@ -283,14 +282,13 @@
283282
]
284283

285284
# Documents to append as an appendix to all manuals.
286-
#texinfo_appendices = []
285+
# texinfo_appendices = []
287286

288287
# If false, no module index is generated.
289-
#texinfo_domain_indices = True
288+
# texinfo_domain_indices = True
290289

291290
# How to display URL addresses: 'footnote', 'no', or 'inline'.
292-
#texinfo_show_urls = 'footnote'
291+
# texinfo_show_urls = 'footnote'
293292

294293
# If true, do not generate a @detailmenu in the "Top" node's menu.
295-
#texinfo_no_detailmenu = False
296-
294+
# texinfo_no_detailmenu = False

‎ffiwrappers/src/arlwrap.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ def arl_invert_2d_ffi(invis, in_image, dopsf, out_image, sumwt):
11961196
@ff.callback("void (*)(const ARLVis *, Image *)", onerror=handle_error)
11971197
def arl_create_image_from_visibility_ffi(vis_in, img_in):
11981198
c_vis = cARLVis(vis_in)
1199-
c_img = cImage(img_in, new=True);
1199+
c_img = cImage(img_in, new=True)
12001200

12011201
# We need a proper Visibility object - not this, and not a cARLVis
12021202
# This is temporary - just so we have some data to pass to
@@ -1240,7 +1240,7 @@ def arl_create_image_from_blockvisibility_ffi(lowconfig, blockvis_in, cellsize,
12401240
equinox='J2000')
12411241

12421242
# Re-creating Image object
1243-
py_outimg = cImage(img_out, new=True);
1243+
py_outimg = cImage(img_out, new=True)
12441244

12451245
# Construct a model from py_blockvisin
12461246
res = create_image_from_visibility(py_blockvisin, npixel=npixel, frequency=[numpy.average(frequency)], nchan=1,

‎ffiwrappers/src/old/ffi_pyroutines.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
"""
55

66
import collections
7-
import cffi
8-
9-
import arlwrap
107

8+
import cffi
119

1210
ff = cffi.FFI()
1311

@@ -16,6 +14,7 @@
1614

1715
count = 0
1816

17+
1918
# ff.callback exports the C prototype
2019
@ff.callback("int(char *)")
2120
def print_hello_from_python(name=None):
@@ -25,20 +24,21 @@ def print_hello_from_python(name=None):
2524
elif isinstance(name, ff.CData):
2625
name = ff.string(name).decode("utf-8")
2726
print("Hello from Python, {}!".format(name))
28-
27+
2928
if name:
3029
return len(name)
3130
return 0
3231

32+
3333
# Store the function pointer in an CFFI_func object.
3434
ffi_phfp = ffi_func(int(ff.cast("size_t", print_hello_from_python)))
3535

36+
3637
@ff.callback("int(void)")
3738
def get_count_from_python(name=None):
3839
global count
39-
count = count + 1;
40+
count = count + 1
4041
return count
4142

4243

4344
ffi_gcfp = ffi_func(int(ff.cast("size_t", get_count_from_python)))
44-

0 commit comments

Comments
 (0)