mirror of
https://github.com/kernc/backtesting.py.git
synced 2024-01-28 15:29:30 +03:00
MNT: Move extras/scripts around a bit
This commit is contained in:
9
doc/scripts/ipython_config.py
Normal file
9
doc/scripts/ipython_config.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# In build.sh, this file is copied into (and removed from)
|
||||
# ~/.ipython/profile_default/startup/
|
||||
|
||||
import pandas as pd
|
||||
pd.set_option("display.max_rows", 30)
|
||||
# This an alternative to setting display.preceision=2,
|
||||
# which doesn't work well for our dtype=object Series.
|
||||
pd.set_option('display.float_format', '{:.2f}'.format)
|
||||
del pd
|
||||
29
doc/scripts/logo.py
Normal file
29
doc/scripts/logo.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from bokeh.io import show, output_file
|
||||
from bokeh.models import ColumnDataSource
|
||||
from bokeh.plotting import figure
|
||||
|
||||
output_file("backtesting_logo.html")
|
||||
|
||||
source = ColumnDataSource(data=dict(
|
||||
colors=[['#00a618', '#d0d000', 'tomato'][i]
|
||||
for i in [0, 0, 1, 0, 1, 0, 0, 1, 0, 2]],
|
||||
x=list(range(10)),
|
||||
bottom=[1, 3, 4, 3, 2, 3, 5, 5, 7, 6.5],
|
||||
top= [4, 7, 6, 5, 4, 6, 8, 7, 9, 8])) # noqa: E222,E251
|
||||
|
||||
|
||||
p = figure(plot_height=800, plot_width=1200, tools='wheel_zoom,save')
|
||||
p.vbar('x', .6, 'bottom', 'top', source=source,
|
||||
line_color='black', line_width=2,
|
||||
fill_color='colors')
|
||||
|
||||
p.xgrid.grid_line_color = None
|
||||
p.ygrid.grid_line_color = None
|
||||
p.y_range.start = -2
|
||||
p.y_range.end = 12
|
||||
p.x_range.start = -2
|
||||
p.x_range.end = 11
|
||||
p.background_fill_color = None
|
||||
p.border_fill_color = None
|
||||
|
||||
show(p)
|
||||
7
doc/scripts/strip_yaml.awk
Normal file
7
doc/scripts/strip_yaml.awk
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/awk -f
|
||||
|
||||
# Remove YAML front matter from jupytext-converted .py notebooks
|
||||
|
||||
BEGIN { drop = 0; }
|
||||
/^# ---$/ { if (NR <= 3) { drop = 1 } else { drop = 0; next } }
|
||||
drop == 0 { print }
|
||||
Reference in New Issue
Block a user