Skip to content

Commit

Permalink
merge dev/origin branch into vkhomyakov branch
Browse files Browse the repository at this point in the history
  • Loading branch information
vkhomyakov committed Dec 22, 2023
2 parents 7aac739 + 4281348 commit 8dc7987
Show file tree
Hide file tree
Showing 25 changed files with 436 additions and 624 deletions.
37 changes: 29 additions & 8 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
version: 3.8
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- docs
system_packages: true
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ language: python
dist: focal

python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"

# command to install dependencies
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import sys
from os import path

import okama # isort:skip

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -19,6 +17,7 @@
sys.path.append(os.path.abspath("matplotlib_ext"))
# sys.path.insert(0, os.path.abspath("."))

import okama # isort:skip

# -- Project information -----------------------------------------------------

Expand Down
3 changes: 1 addition & 2 deletions docs/matplotlib_ext/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def _parse(self):
msg = "Docstring contains a Receives section but not Yields."
raise ValueError(msg)

for (section, content) in sections:
for section, content in sections:
if not section.startswith(".."):
section = (s.capitalize() for s in section.split(" "))
section = " ".join(section)
Expand Down Expand Up @@ -605,7 +605,6 @@ def __init__(self, obj, doc=None, config={}):


class ClassDoc(NumpyDocString):

extra_public_methods = ["__call__"]

def __init__(self, cls, doc=None, modulename="", func_doc=FunctionDoc, config={}):
Expand Down
34 changes: 29 additions & 5 deletions docs/readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build from the docs/ directory with Sphinx
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Explicitly set the version of Python and its requirements
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
version: 3.8
install:
- requirements: docs/requirements.txt
install:
- requirements: docs/requirements.txt
13 changes: 7 additions & 6 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
sphinx==3.5.4
sphinx_rtd_theme==0.5.2
numpydoc==1.1.0
nbsphinx==0.8.7
sphinx
sphinx_rtd_theme
numpydoc
nbsphinx
nbsphinx-link>=1.3.0
pandoc>=1.1.0
recommonmark==0.7.1
recommonmark
ipython>=7.20.0
jinja2==3.0.3
jinja2
-e .
195 changes: 6 additions & 189 deletions examples/01 howto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -322,198 +322,15 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>symbol</th>\n",
" <th>ticker</th>\n",
" <th>name</th>\n",
" <th>country</th>\n",
" <th>exchange</th>\n",
" <th>currency</th>\n",
" <th>type</th>\n",
" <th>isin</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>000906.INDX</td>\n",
" <td>000906</td>\n",
" <td>CHINA SECURITIES INDEX 800</td>\n",
" <td>Unknown</td>\n",
" <td>INDX</td>\n",
" <td>USD</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>0O7N.INDX</td>\n",
" <td>0O7N</td>\n",
" <td>SCALE ALL SHARE GR EUR</td>\n",
" <td>Germany</td>\n",
" <td>INDX</td>\n",
" <td>EUR</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3LHE.INDX</td>\n",
" <td>3LHE</td>\n",
" <td>ESTX 50 CORPORATE BOND TR</td>\n",
" <td>Greece</td>\n",
" <td>INDX</td>\n",
" <td>EUR</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>5SP2550.INDX</td>\n",
" <td>5SP2550</td>\n",
" <td>S&amp;P 500 RETAILING INDEX</td>\n",
" <td>USA</td>\n",
" <td>INDX</td>\n",
" <td>USD</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>990100.INDX</td>\n",
" <td>990100</td>\n",
" <td>MSCI International World Index Price</td>\n",
" <td>Unknown</td>\n",
" <td>INDX</td>\n",
" <td>USD</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>662</th>\n",
" <td>XNG.INDX</td>\n",
" <td>XNG</td>\n",
" <td>ARCA Natural Gas</td>\n",
" <td>USA</td>\n",
" <td>INDX</td>\n",
" <td>USD</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>663</th>\n",
" <td>XOI.INDX</td>\n",
" <td>XOI</td>\n",
" <td>ARCA Oil</td>\n",
" <td>USA</td>\n",
" <td>INDX</td>\n",
" <td>USD</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>664</th>\n",
" <td>XU030.INDX</td>\n",
" <td>XU030</td>\n",
" <td>BIST 30</td>\n",
" <td>Turkey</td>\n",
" <td>INDX</td>\n",
" <td>TRY</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>665</th>\n",
" <td>XU100.INDX</td>\n",
" <td>XU100</td>\n",
" <td>BIST 100</td>\n",
" <td>Turkey</td>\n",
" <td>INDX</td>\n",
" <td>TRY</td>\n",
" <td>INDEX</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" <tr>\n",
" <th>666</th>\n",
" <td>YMU0.INDX</td>\n",
" <td>YMU0</td>\n",
" <td>E-mini Dow $5 Future Sept 20</td>\n",
" <td>USA</td>\n",
" <td>INDX</td>\n",
" <td>USD</td>\n",
" <td>Futures</td>\n",
" <td>&lt;NA&gt;</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>667 rows × 8 columns</p>\n",
"</div>"
],
"text/plain": [
" symbol ticker name country \\\n",
"0 000906.INDX 000906 CHINA SECURITIES INDEX 800 Unknown \n",
"1 0O7N.INDX 0O7N SCALE ALL SHARE GR EUR Germany \n",
"2 3LHE.INDX 3LHE ESTX 50 CORPORATE BOND TR Greece \n",
"3 5SP2550.INDX 5SP2550 S&P 500 RETAILING INDEX USA \n",
"4 990100.INDX 990100 MSCI International World Index Price Unknown \n",
".. ... ... ... ... \n",
"662 XNG.INDX XNG ARCA Natural Gas USA \n",
"663 XOI.INDX XOI ARCA Oil USA \n",
"664 XU030.INDX XU030 BIST 30 Turkey \n",
"665 XU100.INDX XU100 BIST 100 Turkey \n",
"666 YMU0.INDX YMU0 E-mini Dow $5 Future Sept 20 USA \n",
"\n",
" exchange currency type isin \n",
"0 INDX USD INDEX <NA> \n",
"1 INDX EUR INDEX <NA> \n",
"2 INDX EUR INDEX <NA> \n",
"3 INDX USD INDEX <NA> \n",
"4 INDX USD INDEX <NA> \n",
".. ... ... ... ... \n",
"662 INDX USD INDEX <NA> \n",
"663 INDX USD INDEX <NA> \n",
"664 INDX TRY INDEX <NA> \n",
"665 INDX TRY INDEX <NA> \n",
"666 INDX USD Futures <NA> \n",
"\n",
"[667 rows x 8 columns]"
]
"text/plain": " symbol ticker name country \\\n0 000906.INDX 000906 China Securities 800 Unknown \n1 0O7N.INDX 0O7N Scale All Share GR EUR Germany \n2 3LHE.INDX 3LHE ESTX 50 Corporate Bond TR Greece \n3 5SP2550.INDX 5SP2550 S&P 500 Retailing (Industry Group) USA \n4 990100.INDX 990100 MSCI International World Index Price Unknown \n... ... ... ... ... \n1509 XU100.INDX XU100 BIST 100 Turkey \n1510 XUSIN.INDX XUSIN BIST Industrials Turkey \n1511 XUSRD.INDX XUSRD BIST Sustainability Turkey \n1512 XUTEK.INDX XUTEK BIST Technology Turkey \n1513 YMU0.INDX YMU0 E-mini Dow $5 Future Sept 20 USA \n\n exchange currency type isin \n0 INDX USD INDEX \n1 INDX EUR INDEX \n2 INDX EUR INDEX \n3 INDX USD INDEX \n4 INDX USD INDEX \n... ... ... ... ... \n1509 INDX TRY INDEX \n1510 INDX TRY INDEX \n1511 INDEX TRY INDEX \n1512 INDEX TRY INDEX \n1513 INDX USD Futures \n\n[1514 rows x 8 columns]",
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>symbol</th>\n <th>ticker</th>\n <th>name</th>\n <th>country</th>\n <th>exchange</th>\n <th>currency</th>\n <th>type</th>\n <th>isin</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>000906.INDX</td>\n <td>000906</td>\n <td>China Securities 800</td>\n <td>Unknown</td>\n <td>INDX</td>\n <td>USD</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>1</th>\n <td>0O7N.INDX</td>\n <td>0O7N</td>\n <td>Scale All Share GR EUR</td>\n <td>Germany</td>\n <td>INDX</td>\n <td>EUR</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>2</th>\n <td>3LHE.INDX</td>\n <td>3LHE</td>\n <td>ESTX 50 Corporate Bond TR</td>\n <td>Greece</td>\n <td>INDX</td>\n <td>EUR</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>3</th>\n <td>5SP2550.INDX</td>\n <td>5SP2550</td>\n <td>S&amp;P 500 Retailing (Industry Group)</td>\n <td>USA</td>\n <td>INDX</td>\n <td>USD</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>4</th>\n <td>990100.INDX</td>\n <td>990100</td>\n <td>MSCI International World Index Price</td>\n <td>Unknown</td>\n <td>INDX</td>\n <td>USD</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>1509</th>\n <td>XU100.INDX</td>\n <td>XU100</td>\n <td>BIST 100</td>\n <td>Turkey</td>\n <td>INDX</td>\n <td>TRY</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>1510</th>\n <td>XUSIN.INDX</td>\n <td>XUSIN</td>\n <td>BIST Industrials</td>\n <td>Turkey</td>\n <td>INDX</td>\n <td>TRY</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>1511</th>\n <td>XUSRD.INDX</td>\n <td>XUSRD</td>\n <td>BIST Sustainability</td>\n <td>Turkey</td>\n <td>INDEX</td>\n <td>TRY</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>1512</th>\n <td>XUTEK.INDX</td>\n <td>XUTEK</td>\n <td>BIST Technology</td>\n <td>Turkey</td>\n <td>INDEX</td>\n <td>TRY</td>\n <td>INDEX</td>\n <td></td>\n </tr>\n <tr>\n <th>1513</th>\n <td>YMU0.INDX</td>\n <td>YMU0</td>\n <td>E-mini Dow $5 Future Sept 20</td>\n <td>USA</td>\n <td>INDX</td>\n <td>USD</td>\n <td>Futures</td>\n <td></td>\n </tr>\n </tbody>\n</table>\n<p>1514 rows × 8 columns</p>\n</div>"
},
"execution_count": 7,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -1928,9 +1745,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "py39",
"name": "okama3.11dev",
"language": "python",
"name": "py39"
"display_name": "okama3.11dev"
},
"language_info": {
"codemirror_mode": {
Expand Down
2 changes: 1 addition & 1 deletion examples/02 index funds perfomance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
}
],
"source": [
"x.index_corr().plot(); # expanding correlation rolling_window = None"
"x.index_corr().plot(); # expanding correlation rolling_window = None"
]
},
{
Expand Down
Loading

0 comments on commit 8dc7987

Please sign in to comment.