From e1e82b2ecb07cae401477de0401b22af8719543f Mon Sep 17 00:00:00 2001 From: Enzo Busseti Date: Sat, 16 Dec 2023 12:41:24 +0400 Subject: [PATCH] docs examples structure --- docs/examples.rst | 10 +++++----- docs/examples/case_shiller.rst | 4 ++-- docs/examples/dow30.rst | 6 +++--- docs/examples/etfs.rst | 8 ++++++++ docs/examples/paper_examples.rst | 7 +++++++ docs/examples/paper_examples/data_risk_model.rst | 10 ++++++++++ docs/examples/timing.rst | 8 ++++++++ docs/examples/universes.rst | 12 ++++++++++++ docs/examples/user_provided_forecasters.rst | 0 examples/{etfs_example.py => etfs.py} | 0 10 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 docs/examples/etfs.rst create mode 100644 docs/examples/paper_examples.rst create mode 100644 docs/examples/paper_examples/data_risk_model.rst create mode 100644 docs/examples/timing.rst create mode 100644 docs/examples/universes.rst create mode 100644 docs/examples/user_provided_forecasters.rst rename examples/{etfs_example.py => etfs.py} (100%) diff --git a/docs/examples.rst b/docs/examples.rst index abfb5e2df..a87901e6e 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -4,13 +4,13 @@ Examples Many `example scripts are available in the code repository. `_ We show some of them, along with their results, in the following pages: -.. - :doc:`Hello World example ` -.. - :doc:`Case-Shiller example ` - - .. toctree:: :maxdepth: 2 hello_world examples/case_shiller - examples/dow30 \ No newline at end of file + examples/dow30 + examples/timing + examples/universes + examples/etfs + examples/paper_examples \ No newline at end of file diff --git a/docs/examples/case_shiller.rst b/docs/examples/case_shiller.rst index 737616a05..cf74b6c78 100644 --- a/docs/examples/case_shiller.rst +++ b/docs/examples/case_shiller.rst @@ -1,5 +1,5 @@ -Case-Shiller Example -==================== +Case-Shiller multi-period +========================= This is an example that shows that Cvxportfolio can work as well with different asset classes, in this case a real estate portfolio. We use diff --git a/docs/examples/dow30.rst b/docs/examples/dow30.rst index 9f39728b4..6b8ff5852 100644 --- a/docs/examples/dow30.rst +++ b/docs/examples/dow30.rst @@ -1,11 +1,11 @@ -DOW30 Example +DOW30 monthly ============= This example script is -`available in the repository `_. +`available in the repository `_. See the docstring below for its explanation. -.. literalinclude:: ../../examples/dow30_example.py +.. literalinclude:: ../../examples/dow30.py :language: python This is the output printed to screen when executing this script. You can see diff --git a/docs/examples/etfs.rst b/docs/examples/etfs.rst new file mode 100644 index 000000000..7e46a8aa2 --- /dev/null +++ b/docs/examples/etfs.rst @@ -0,0 +1,8 @@ +Wide asset classes ETFs +======================= + +This example script is +`available in the repository `_. + +.. literalinclude:: ../../examples/etfs.py + :language: python diff --git a/docs/examples/paper_examples.rst b/docs/examples/paper_examples.rst new file mode 100644 index 000000000..f5373ab48 --- /dev/null +++ b/docs/examples/paper_examples.rst @@ -0,0 +1,7 @@ +Original examples from the paper +================================ + +.. toctree:: + :maxdepth: 2 + + paper_examples/data_risk_model \ No newline at end of file diff --git a/docs/examples/paper_examples/data_risk_model.rst b/docs/examples/paper_examples/data_risk_model.rst new file mode 100644 index 000000000..1df3d6ea7 --- /dev/null +++ b/docs/examples/paper_examples/data_risk_model.rst @@ -0,0 +1,10 @@ +Data and risk model estimates +============================= + +This example script is +`available in the repository +`_. +See the docstring below for its explanation. + +.. literalinclude:: ../../../examples/paper_examples/data_risk_model.py + :language: python \ No newline at end of file diff --git a/docs/examples/timing.rst b/docs/examples/timing.rst new file mode 100644 index 000000000..4395ed060 --- /dev/null +++ b/docs/examples/timing.rst @@ -0,0 +1,8 @@ +Timing of back-test +=================== + +This example script is +`available in the repository `_. + +.. literalinclude:: ../../examples/timing.py + :language: python diff --git a/docs/examples/universes.rst b/docs/examples/universes.rst new file mode 100644 index 000000000..4e09bd0c1 --- /dev/null +++ b/docs/examples/universes.rst @@ -0,0 +1,12 @@ +Stock universes +=============== + +This example module is +`available in the repository `_. +See the docstring below for its explanation. It's used by other examples +to get lists of stock tickers corresponding to various indexes. We run +it periodically to update the lists to the current constituents of each +index. + +.. literalinclude:: ../../examples/universes.py + :language: python diff --git a/docs/examples/user_provided_forecasters.rst b/docs/examples/user_provided_forecasters.rst new file mode 100644 index 000000000..e69de29bb diff --git a/examples/etfs_example.py b/examples/etfs.py similarity index 100% rename from examples/etfs_example.py rename to examples/etfs.py