Skip to content

Commit

Permalink
DOCS: update 1.7.x (#673)
Browse files Browse the repository at this point in the history
Co-authored-by: JHM Darbyshire (M1) <[email protected]>
  • Loading branch information
attack68 and attack68 committed Feb 2, 2025
1 parent f9adcb9 commit 4477064
Show file tree
Hide file tree
Showing 16 changed files with 415 additions and 187 deletions.
95 changes: 83 additions & 12 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Attribution-NonCommercial-NoDerivatives 4.0 International

=======================================================================

This an an amended Creative Commons Attribution-NonCommercial-NoDerivatives
4.0 International licence.

Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
Expand Down Expand Up @@ -54,11 +57,11 @@ exhaustive, and do not form part of our licenses.

=======================================================================

Creative Commons Attribution-NonCommercial-NoDerivatives 4.0
Amended Creative Commons Attribution-NonCommercial-NoDerivatives 4.0
International Public License

By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
to be bound by the terms and conditions of this Amended Creative Commons
Attribution-NonCommercial-NoDerivatives 4.0 International Public
License ("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
Expand Down Expand Up @@ -102,6 +105,9 @@ Section 1 -- Definitions.
or other material to which the Licensor applied this Public
License.

All of Rateslib's codebases, documentation, and other training
materials falls under Licensed Material.

f. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Expand All @@ -110,31 +116,72 @@ Section 1 -- Definitions.
g. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.

The Licensor for Rateslib is Siffrorna Technology Limited.

h. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.

i. Share means to provide material to the public by any means or
commercial advantage or monetary compensation. NonCommercial cannot
also be any of the activities defined as Commercial.

i. Commercial means use intended for or directed towards commercial
advantage or monetary compensation.

In the context of Rateslib the definition of Commercial includes:

- Code execution on any physical operating system or virtual
environment owned by a commercial entity.
- Installation on any operating system owned by a commercial entity via
methods such as; direct code transfer from source, installation via PyPI,
installation via Conda.
- Installation in a virtual environment from a machine
owned by a commercial entity, such as in a WebBrowser via PyOdide or
in a BQuant environment via a Bloomberg Terminal.
- Including Rateslib code directly, or as a software dependency, in the
creation of another software product, used either internally by that
creating commercial entity or for transmission or resale to
associates or customers of the creating commercial entity.

j. First-hand Commercial Use means any Commercial activity used only
internally and exclusively by You.

k. Second-hand Commercial Use means packaging, distributing and
re-selling any of the functions defined as Commercial to any
third-party.

l. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.

j. Sui Generis Database Rights means rights other than copyright
m. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.

k. You means the individual or entity exercising the Licensed Rights
n. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.

o. User is a person or a device that executes Rateslib source code.
A single user constitutes:

- A person that installs Rateslib on any of their operating systems
or virtual machines and executes its source code non-synchronously.
- A person that connects to a server (local or cloud based) and
executes Rateslib source code remotely accessing the results from
the request.
- A server that installs Rateslib and executes its source code for
any reason, e.g. to perform scheduled daily tasks, generate results,
or respond to queries from incoming API requests.
- A person that regularly uses and consumes streaming results
generated from Rateslib source code on a remote server.

For the avoidance of doubt a recipient of an isolated report which
has been produced in whole, or in part, by Rateslib is not a User. However,
the producer of that report is a User.


Section 2 -- Scope.

Expand Down Expand Up @@ -380,6 +427,30 @@ Section 8 -- Interpretation.
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.

Section 9 -- Commercial Licence Extension

a. The Licensor may grant explicitly, or for a royalty fee,
a specific amendment to this licence which permits
Section 2.a) 1.b) for Commercial purposes as well as
NonCommercial.

b. For the avoidance of doubt Section 2.a) 1.a) is not
amended under a Commercial Licence Extension. This provides
the distinction between First-Hand Commercial Use and
Second-Hand Commercial Use, the former being permitted
under a Commercial Licence Extension, whilst the latter
remains prohibited.

c. Commercial Licence Extensions may be granted to an entire
commercial entity or per User. In the case a Commercial
Licence Extension is granted per User the definition of
User is as given in Section 1.

d. Commercial Licence Extensions are granted with their own
terms of contract which often involve a negotiated fee
and a date of expiration at which point the licence reverts
back to the NonCommercial version.

=======================================================================

Creative Commons is not a party to its public
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_static/badges.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"coverage": "97%",
"coverage": "94%",
"licence": "CC-BY-NC-ND-4.0",
"pypi": "v1.7.0",
"conda": "v1.7.0",
Expand Down
44 changes: 43 additions & 1 deletion docs/source/_static/css/overwrites.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,46 @@ table.scrollwide td {
background-color: #c4dfe9 !important;
}

span.spamoff {display: none;}
span.spamoff {display: none;}

.flex-container-line {
display: flex; /* Makes this a true flex container! */
padding: 10px;
margin: 0;
flex-direction: row;
justify-content: start;
flex-wrap: wrap;
}

.flex-item {
border-left: 2px solid #cecece;
border-radius: 0px;
width: 190px;
text-align: left;
padding: 1.5em;
padding-right: 0em;
}

.flex-item-right {
width: 500px;
text-align: left;
padding: 1.5em;
padding-right: 0em;
}

.flex-item:hover {
/*background-color: rgba(255, 140, 0, 0.25);*/
background-image: linear-gradient(to right, rgba(255, 140, 0, 0.35), rgba(255,140,0,0));
}

.purchase-btn {
border: 1px solid lightgrey;
border-radius: 15px;
padding: 0.4em;
margin: 0px 10px;
background: #eaebf5;
}

.purchase-btn:hover {
border: 1px solid grey;
}
Binary file added docs/source/_static/rateslib_excel_logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/rateslib_js_logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/rateslib_rs_logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Rateslib'
copyright = '2022, JHM Darbyshire'
copyright = '2022, 2023, 2024, 2025, Siffrorna Technology Limited'
author = 'JHM Darbyshire'
release = 'dev'

Expand Down
2 changes: 1 addition & 1 deletion docs/source/e_combinations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Utilities

The :class:`~rateslib.instruments.Value` and :class:`~rateslib.instruments.VolValue` class
serve as null *Instruments*, whose purpose is to directly parametrize a :ref:`Curve<curves-doc>`,
:ref:`FXDeltaVolSmile<c-fx-smile-doc>` or :class:`~rateslib.fx_volatility.FXDeltaVolSurface via a
:ref:`FXDeltaVolSmile<c-fx-smile-doc>` or :class:`~rateslib.fx_volatility.FXDeltaVolSurface` via a
:class:`~rateslib.solver.Solver`, without complicated *Instrument* construction.

.. inheritance-diagram:: rateslib.instruments.Value rateslib.instruments.VolValue
Expand Down
104 changes: 62 additions & 42 deletions docs/source/g_coverage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,71 @@
Coverage
***********

The **test coverage** of this library is extensive. There are over 2800 unit tests
The **test coverage** of this library is extensive. There are over 2900 unit tests
with the following coverage report:

**Test Coverage Report: as of commit #4b848b6b**
**Test Coverage Report: as of commit #89ea2154**

.. code-block::
Name LINES MISS %
-------------------------------------------------------------------
\__init__.py 38 0 100%
\_spec_loader.py 61 2 97%
\calendars\__init__.py 98 0 100%
\calendars\dcfs.py 140 8 94%
\calendars\rs.py 52 2 96%
\curves\__init__.py 2 0 100%
\curves\curves.py 674 15 98%
\curves\rs.py 73 8 89%
\default.py 118 10 92%
\dual\__init__.py 105 8 92%
\dual\variable.py 125 16 87%
\fx\__init__.py 3 0 100%
\fx\fx_forwards.py 339 20 94%
\fx\fx_rates.py 139 0 100%
\fx_volatility.py 332 36 89%
\instruments\__init__.py 8 0 100%
\instruments\bonds\__init__.py 5 0 100%
\instruments\bonds\conventions\__init__.py 51 4 92%
\instruments\bonds\conventions\accrued.py 49 1 98%
\instruments\bonds\conventions\discounting.py 54 3 94%
\instruments\bonds\futures.py 185 26 86%
\instruments\bonds\securities.py 474 27 94%
\instruments\core.py 305 12 96%
\instruments\fx_volatility.py 353 14 96%
\instruments\generics.py 162 11 93%
\instruments\rates_derivatives.py 355 6 98%
\instruments\rates_multi_ccy.py 326 1 99%
\json.py 10 0 100%
\legs.py 560 0 100%
\periods.py 1176 67 94%
\scheduling.py 362 2 99%
\solver.py 704 19 97%
\splines.py 14 0 100%
-------------------------------------------------------------------
TOTAL 7452 318 96%
Name Stmts Miss Cover Missing
--------------------------------------------------------------------------------------------
python/rateslib/__init__.py 38 0 100%
python/rateslib/_spec_loader.py 63 54 14% 17-99
python/rateslib/calendars/__init__.py 110 2 98% 18, 346
python/rateslib/calendars/dcfs.py 143 10 93% 13, 41-42, 128, 196, 198, 200, 223, 242, 275
python/rateslib/calendars/rs.py 73 14 81% 10, 161-170, 184, 188, 195, 199
python/rateslib/curves/__init__.py 2 0 100%
python/rateslib/curves/_parsers.py 107 4 96% 12, 201, 216, 247
python/rateslib/curves/curves.py 760 29 96% 44, 235, 447, 475, 1132, 1218, 1221, 1229-1230, 1472, 1475, 1509, 1567, 1770, 2377, 2457, 2504, 2563, 2644, 2646, 2657, 2676, 2680, 2684, 2688, 2692, 2696, 2818, 2923
python/rateslib/curves/rs.py 76 9 88% 27, 62, 74, 85-87, 97, 101, 120
python/rateslib/default.py 121 10 92% 294-381, 410-420
python/rateslib/dual/__init__.py 9 0 100%
python/rateslib/dual/newton.py 95 1 99% 13
python/rateslib/dual/quadratic.py 19 6 68% 8, 54-57, 71, 91
python/rateslib/dual/utils.py 134 19 86% 15, 34, 43, 53, 117-120, 124-127, 162, 171, 179, 186, 323, 327, 345-348
python/rateslib/dual/variable.py 131 18 86% 14, 69, 88, 91, 94, 97, 100, 116, 133, 156, 173, 189, 212-217
python/rateslib/fx/__init__.py 3 0 100%
python/rateslib/fx/fx_forwards.py 367 9 98% 20, 814, 816, 830, 1027, 1036, 1045, 1135, 1137
python/rateslib/fx/fx_rates.py 150 1 99% 28
python/rateslib/fx_volatility.py 364 38 90% 391-402, 537-567, 733, 735, 737, 1140-1144, 1384
python/rateslib/instruments/__init__.py 9 0 100%
python/rateslib/instruments/base.py 119 1 99% 21
python/rateslib/instruments/bonds/__init__.py 5 0 100%
python/rateslib/instruments/bonds/conventions/__init__.py 55 5 91% 10, 201, 358-360
python/rateslib/instruments/bonds/conventions/accrued.py 53 2 96% 11, 98
python/rateslib/instruments/bonds/conventions/discounting.py 58 4 93% 10, 145, 227-228
python/rateslib/instruments/bonds/futures.py 180 28 84% 19, 295, 451-508, 537, 589, 842-844, 947, 955
python/rateslib/instruments/bonds/securities.py 567 59 90% 47, 276, 288-289, 427-433, 758, 762-768, 813, 852, 854, 860, 862-863, 925-951, 1356, 1747, 1755, 1874, 2363-2366, 2418-2420, 2645, 2655, 2676, 2737, 3001, 3009, 3138-3139
python/rateslib/instruments/credit/__init__.py 2 0 100%
python/rateslib/instruments/credit/derivatives.py 45 2 96% 18, 112
python/rateslib/instruments/fx_volatility/__init__.py 3 0 100%
python/rateslib/instruments/fx_volatility/strategies.py 283 16 94% 22, 73-79, 87-93, 119, 354, 1252-1254
python/rateslib/instruments/fx_volatility/vanilla.py 151 5 97% 27-29, 267, 378-379
python/rateslib/instruments/generics.py 180 12 93% 27, 137, 264-266, 269, 272, 275, 423, 431, 643, 665-671
python/rateslib/instruments/rates/__init__.py 4 0 100%
python/rateslib/instruments/rates/inflation.py 100 2 98% 17, 559
python/rateslib/instruments/rates/multi_currency.py 371 2 99% 43, 268
python/rateslib/instruments/rates/single_currency.py 288 13 95% 33-35, 678, 703, 1565, 1567, 1569, 1571, 1692, 1701, 1744, 1822, 1848
python/rateslib/instruments/sensitivities.py 57 3 95% 17, 144, 155
python/rateslib/instruments/utils.py 132 23 83% 15, 136, 162, 169-182, 241-242, 283-284, 288, 302-304, 308-310
python/rateslib/json.py 11 0 100%
python/rateslib/legs.py 669 8 99% 35, 1374, 1491, 1567, 1913, 2413, 2692, 3054
python/rateslib/mutability/__init__.py 70 2 97% 12, 119
python/rateslib/periods/__init__.py 7 0 100%
python/rateslib/periods/base.py 52 1 98% 14
python/rateslib/periods/cashflow.py 97 2 98% 18, 360
python/rateslib/periods/credit.py 122 6 95% 19, 198-200, 308, 419
python/rateslib/periods/fx_volatility.py 463 60 87% 32, 155, 158, 220, 234, 303, 342, 458, 475, 970, 1143-1225, 1250, 1271
python/rateslib/periods/index.py 143 7 95% 21, 112-116, 143, 172, 205, 324
python/rateslib/periods/rates.py 445 14 97% 30, 144, 756, 763, 1197, 1339, 1418-1424, 1426-1432, 1569, 1662
python/rateslib/periods/utils.py 116 11 91% 15, 196-197, 205, 231-234, 239, 250, 277, 282
python/rateslib/scheduling.py 356 4 99% 27, 946, 1111, 1606
python/rateslib/solver.py 729 23 97% 36-40, 1125, 1255, 1324, 1335, 1430, 1482, 1563, 1732, 1742, 1750, 2036, 2065-2072, 2221, 2230-2233, 2257
python/rateslib/splines.py 25 1 96% 11
--------------------------------------------------------------------------------------------
TOTAL 8732 540 94%
It should be noted that test coverage is not the same as hypothesis testing and ensuring
that the results of combinations of input arguments has the desired effect. This is
Expand All @@ -59,11 +80,10 @@ the disclaimer is that some edge cases may well be missed.
Style
*****

*Rateslib* uses `black` and `ruff` as a PEP8 compliant opinionated code styler.
*Rateslib* uses `ruff` as a PEP8 compliant opinionated code styler.

******
Typing
******

*Rateslib* strives to ultimately be fully explicitly typed, but this
has not yet been implemented, and will form part of its phase 3 development.
*Rateslib* is statically typed and uses `mypy` as a type checker.
Loading

0 comments on commit 4477064

Please sign in to comment.