Skip to content

Commit c6feccc

Browse files
committed
Fixed Spelling Mistake
1 parent 83c4cbe commit c6feccc

7 files changed

Lines changed: 180 additions & 127 deletions

File tree

Example_CVE_Analysis.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"id": "c1896d48-4e54-4c3a-b288-d905364ea2bd",
7171
"metadata": {},
7272
"source": [
73-
"Then, we analyse it using our maximum likelihood estimator function."
73+
"Then, we analyse it using our CVE estimator function."
7474
]
7575
},
7676
{
@@ -117,7 +117,7 @@
117117
"id": "0e10ab24-f180-4f27-95f9-d0002fc296d0",
118118
"metadata": {},
119119
"source": [
120-
"This may be not exactly correct! We can quickly simulate 1,000 different actualisations of our coordinate to confirm that on average our MLE does well."
120+
"This may be not exactly correct! We can quickly simulate 1,000 different actualisations of our coordinate to confirm that on average our CVE does well."
121121
]
122122
},
123123
{

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/conf.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = 'pyDiffusion_LeeLab'
10+
copyright = '2024, Joseph S. Beckwith'
11+
author = 'Joseph S. Beckwith'
12+
release = 'v0.1.0'
13+
14+
# -- General configuration ---------------------------------------------------
15+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
16+
17+
extensions = []
18+
19+
templates_path = ['_templates']
20+
exclude_patterns = []
21+
22+
23+
24+
# -- Options for HTML output -------------------------------------------------
25+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
26+
27+
html_theme = 'alabaster'
28+
html_static_path = ['_static']

docs/source/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. pyDiffusion_LeeLab documentation master file, created by
2+
sphinx-quickstart on Thu Apr 25 11:23:00 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to pyDiffusion_LeeLab's documentation!
7+
==============================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
14+
15+
Indices and tables
16+
==================
17+
18+
* :ref:`genindex`
19+
* :ref:`modindex`
20+
* :ref:`search`

src/LangevinFunctions.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ def BrownianTrans_Ideal(self, DT, n_d, deltaT, N):
8686

8787
def BrownianRot(self, DR, TStep, NSteps):
8888
""" BrownianRot function
89-
# generates random rotational motion
90-
# using DR and TStep
91-
# ================INPUTS=============
92-
# DR is rotational diffusion coefficient
93-
# TStep is time step relative to DT
94-
# NSteps is number of steps to simulate
95-
# ================OUTPUT=============
96-
# sph_coords are theta, phi over time """
89+
generates random rotational motion
90+
using DR and TStep
91+
92+
Args:
93+
DR (float): rotational diffusion coefficient
94+
TStep (float): time step relative to DT
95+
NSteps (int): number of steps to simulate
96+
97+
Returns:
98+
sph_coords (np.3Darray): are theta, phi over time """
9799

98100
# generate spherical coordinates using method of Hunter, G. L.;
99101
# Edmond, K. V.; Elsesser, M. T.; Weeks, E. R.

src/PlottingFunctions.py

Lines changed: 65 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,18 @@ def __init__(self, poster=False):
3131
def two_column_plot(self, nrows=1, ncolumns=1, heightratio=[1], widthratio=[1], height=0):
3232
""" two_column_plot function
3333
takes data and makes a two-column width figure
34-
================INPUTS=============
35-
npanels is panel matrix
36-
ratios is size ratios of panels
37-
================OUTPUT=============
38-
fig, axs are figure objects """
34+
35+
Args:
36+
nrows (int): number of rows
37+
ncolumns (int): number of columns
38+
heightratio (np.1darray): array of same length as number of rows
39+
widthratio (np.1darray): array of same length as number of columns
40+
height (float): if set, figure will be this height
41+
42+
Returns:
43+
fig (figure object): figure
44+
axs (axes object): axes
45+
"""
3946

4047
# first, check everything matches
4148
try:
@@ -92,82 +99,20 @@ def two_column_plot(self, nrows=1, ncolumns=1, heightratio=[1], widthratio=[1],
9299
axs[i,j].yaxis.set_tick_params(width=0.5, length=lw*4)
93100
axs[i,j].tick_params(axis='both', pad=1.2)
94101
return fig, axs
95-
96-
def one_column_multirow_plot(self, nrows=1, ncolumns=1, heightratio=[1], widthratio=[1], height=0):
97-
""" one_column_multirow_plot function
98-
takes data and makes a one-column width figure
99-
================INPUTS=============
100-
npanels is panel matrix
101-
ratios is size ratios of panels
102-
================OUTPUT=============
103-
fig, axs are figure objects """
104-
105-
# first, check everything matches
106-
try:
107-
if len(heightratio) != nrows:
108-
raise Exception('Number of height ratios incorrect')
109-
if len(widthratio) != ncolumns:
110-
raise Exception('Number of width ratios incorrect')
111-
except Exception as error:
112-
print('Caught this error: ' + repr(error))
113-
return
114-
115-
if self.poster == True:
116-
fontsz = 12
117-
lw = 1
118-
else:
119-
fontsz = 7
120-
lw = 1
121-
122-
xsize = 3.33 # 3.33 inches for one-column figure
123-
if height is not None:
124-
ysize = np.min([height, 8.25]) # maximum size in y can be 8.25
125-
else:
126-
ysize = np.min([3.5*nrows, 8.25]) # maximum size in y can be 8.25
127-
128-
plt.rcParams['figure.figsize'] = [xsize, ysize]
129-
plt.rcParams['font.size'] = fontsz
130-
plt.rcParams['svg.fonttype'] = 'none'
131-
matplotlib.rcParams['pdf.fonttype'] = 42
132-
matplotlib.rcParams['ps.fonttype'] = 42
133-
plt.rcParams['axes.linewidth'] = lw # set the value globally
134-
135-
fig, axs = plt.subplots(nrows, ncolumns, height_ratios=heightratio,
136-
width_ratios=widthratio) # create number of panels
137-
138-
139-
# clean up axes, tick parameters
140-
if nrows*ncolumns == 1:
141-
axs.xaxis.set_tick_params(width=lw, length=lw*4)
142-
axs.yaxis.set_tick_params(width=lw, length=lw*4)
143-
axs.tick_params(axis='both', pad=1.2)
144-
elif nrows*ncolumns == 2:
145-
for i in np.arange(2):
146-
axs[i].xaxis.set_tick_params(width=lw, length=lw*4)
147-
axs[i].yaxis.set_tick_params(width=lw, length=lw*4)
148-
axs[i].tick_params(axis='both', pad=1.2)
149-
elif nrows*ncolumns == len(widthratio):
150-
for i in np.arange(len(widthratio)):
151-
axs[i].xaxis.set_tick_params(width=lw, length=lw*4)
152-
axs[i].yaxis.set_tick_params(width=lw, length=lw*4)
153-
axs[i].tick_params(axis='both', pad=1.2)
154-
else:
155-
for i in np.arange(nrows):
156-
for j in np.arange(ncolumns):
157-
axs[i,j].xaxis.set_tick_params(width=0.5, length=lw*4)
158-
axs[i,j].yaxis.set_tick_params(width=0.5, length=lw*4)
159-
axs[i,j].tick_params(axis='both', pad=1.2)
160-
return fig, axs
161102

162103
def one_column_plot(self, npanels=1, ratios=[1], height=None):
163104
""" one_column_plot function
164105
takes data and makes a one-column width figure
165-
================INPUTS=============
166-
npanels is number of panels in the figure
167-
ratios is size ratios of panels
168-
height is figure height
169-
================OUTPUT=============
170-
fig, axs are figure objects """
106+
107+
Args:
108+
npanels (int): number of panels in the figure
109+
ratios (np.1darray): size ratios of panels
110+
height (float): figure height
111+
112+
Returns:
113+
fig (figure object): figure
114+
axs (axes object): axes
115+
"""
171116

172117
# first, check everything matches
173118
try:
@@ -251,18 +196,20 @@ def histogram_plot(self, axs, data, bins, xlim=None, ylim=None,
251196
histcolor='gray', xaxislabel='x axis', alpha=1, histtype='bar', density=True):
252197
""" histogram_plot function
253198
takes data and makes a histogram
254-
================INPUTS=============
255-
data is data
256-
bins are bins
257-
xlim is x limits; default is None (which computes max/min)
258-
ylim is y limits; default is None (which lets it keep its default)
259-
histcolor is histogram colour (default is gray)
260-
xaxislabel is x axis label (default is 'x axis')
261-
alpha is histogram transparency (default 1)
262-
density is if to plot as pdf, default yes
263-
histtype is histogram type, default bar
264-
================OUTPUT=============
265-
axs is axis object """
199+
200+
Args:
201+
data (np.1darray): data array
202+
bins (np.1darray): bin array
203+
xlim (boolean or list of two floats): default is None (which computes min/max of x), otherwise provide a min/max
204+
ylim (boolean or list of two floats): default is None (which computes min/max of y), otherwise provide a min/max
205+
histcolor (string): histogram colour (default is gray)
206+
xaxislabel (string): x axis label (default is 'x axis')
207+
alpha (float): histogram transparency (default 1)
208+
histtype (string): histogram type, default bar
209+
density (boolean): if to plot as pdf, default True
210+
211+
Returns:
212+
axs (axis): axis object """
266213
if self.poster == True:
267214
fontsz = 15
268215
else:
@@ -286,21 +233,20 @@ def histogram_plot(self, axs, data, bins, xlim=None, ylim=None,
286233
def scatter_plot(self, axs, x, y, xlim=None, ylim=None, label='',
287234
edgecolor='k', facecolor='white', s=5, lw=0.75, xaxislabel='x axis', yaxislabel='y axis', alpha=1):
288235
""" scatter_plot function
289-
takes data and makes a scatter plot
290-
================INPUTS=============
291-
x is x data
292-
y os y data
293-
xlim is x limits; default is None (which computes max/min)
294-
ylim is y limits; default is None (which computes max/min)
295-
label is label; default is nothing
296-
edgecolor is edge colour; default is black
297-
facecolor is face colour; default is white
298-
s is size of scatter point; default is 5
299-
lw is line width (default 0.75)
300-
xaxislabel is x axis label (default is 'x axis')
301-
yaxislabel is y axis label (default is 'y axis')
302-
================OUTPUT=============
303-
axs is axis object """
236+
takes scatter data and makes an scatter plot
237+
238+
Args:
239+
xdata (np.1darray): scatter points, x
240+
ydata (np.1darray): scatter points, y
241+
xlim (np.1darray): x limits
242+
ylim (np.1darray): y limits
243+
label (string): any annotation
244+
edgecolor (string): colour of scatter plot edges
245+
facecolor (string): colour of scatter point faces
246+
alpha (float): transparency of points
247+
248+
Returns:
249+
axs (axis): axis object """
304250
if self.poster == True:
305251
fontsz = 15
306252
else:
@@ -322,19 +268,21 @@ def image_plot(self, axs, data, vmin=None, vmax=None, cmap='binary', cbar='on',
322268
labelcolor='black', pixelsize=69, scalebarsize=5000, scalebarlabel=r'5$\,\mu$m', alpha=1):
323269
""" image_plot function
324270
takes image data and makes an image plot
325-
================INPUTS=============
326-
data is image
327-
vmin is minimum pixel displayed (default 99.9%)
328-
vmax is maximum pixel displayed (default 0.1%)
329-
cmap is colour map used; default gray
330-
cbarlabel is colour bar label; default intensity
331-
label is any annotation
332-
labelcolor is annotation colour
333-
pixelsize is pixel size in nm for scalebar, default 69
334-
scalebarsize is scalebarsize in nm, default 5000
335-
scalebarlabel is scale bar label, default 5 um
336-
================OUTPUT=============
337-
axs is axis object """
271+
272+
Args:
273+
data (np.2darray): image
274+
vmin (float): minimum pixel intensity displayed (default 0.1%)
275+
vmax (float): minimum pixel intensity displayed (default 99.9%)
276+
cmap (string): colour map used; default gray)
277+
cbarlabel (string): colour bar label; default 'photons'
278+
label (string): is any annotation
279+
labelcolor (string): annotation colour
280+
pixelsize (float): pixel size in nm for scalebar, default 110
281+
scalebarsize (float): scalebarsize in nm, default 5000
282+
scalebarlabel (string): scale bar label, default 5 um
283+
284+
Returns:
285+
axs (axis): axis object """
338286
if vmin is None:
339287
vmin = np.percentile(data.ravel(), 0.1)
340288
if vmax is None:

0 commit comments

Comments
 (0)