-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using type hints throughout FinQuant and introducing type checks in functions/methods that raise appropriate error messages if an argument is of an unexpected type. This commit also introduces custom data types, e.g. `FLOAT` as `Union[np.floating, float]` and more to simplify type hints. Moreover, type validation is now done with a new module/function `type_validation` that also simplifies type validations. Finally, the documentation for all modules in `finquant` has been updated. This closes #94 and also closes #118. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
8a25d0a
commit 2ca498c
Showing
35 changed files
with
1,999 additions
and
1,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.. _assets: | ||
|
||
################# | ||
Individual Assets | ||
################# | ||
FinQuant provides classes for individual assets, such as stocks or funds. These are explained below. | ||
|
||
Asset | ||
===== | ||
.. automodule:: finquant.asset | ||
.. autoclass:: finquant.asset.Asset | ||
:members: | ||
|
||
.. automethod:: __init__ | ||
|
||
|
||
Stock | ||
===== | ||
Inherits from ``Asset``. | ||
|
||
.. automodule:: finquant.stock | ||
.. autoclass:: finquant.stock.Stock | ||
:members: | ||
|
||
.. automethod:: __init__ | ||
|
||
|
||
Market | ||
====== | ||
Inherits from ``Asset``. | ||
|
||
.. automodule:: finquant.market | ||
.. autoclass:: finquant.market.Market | ||
:members: | ||
|
||
.. automethod:: __init__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
.. _developers: | ||
|
||
#################### | ||
Notes for Developers | ||
#################### | ||
|
||
.. note:: Contributions are welcome. If you want to add new functionality please | ||
|
||
1. read through `CONTRIBUTIONS.md` in the root directory of the repository, and | ||
2. familiarize yourself with the custom data types defined in FinQuant, and how type validation is achieved. You find relevant information below. | ||
|
||
********** | ||
Data Types | ||
********** | ||
|
||
Various custom data types are defined in ``finquant.data_types`` and used in FinQuant as type hints. | ||
|
||
Description | ||
########### | ||
|
||
.. automodule:: finquant.data_types | ||
|
||
|
||
|
||
Code Definitions | ||
################ | ||
|
||
Array/List-Like Types | ||
--------------------- | ||
|
||
.. autodata:: finquant.data_types.ARRAY_OR_LIST | ||
:annotation: | ||
|
||
.. autodata:: finquant.data_types.ARRAY_OR_DATAFRAME | ||
:annotation: | ||
|
||
.. autodata:: finquant.data_types.ARRAY_OR_SERIES | ||
:annotation: | ||
|
||
.. autodata:: finquant.data_types.SERIES_OR_DATAFRAME | ||
:annotation: | ||
|
||
List of Dict keys | ||
----------------- | ||
|
||
.. autodata:: finquant.data_types.LIST_DICT_KEYS | ||
:annotation: | ||
|
||
Numeric Types | ||
------------- | ||
|
||
.. autodata:: finquant.data_types.FLOAT | ||
:annotation: | ||
|
||
.. autodata:: finquant.data_types.INT | ||
:annotation: | ||
|
||
.. autodata:: finquant.data_types.NUMERIC | ||
:annotation: | ||
|
||
|
||
*************** | ||
Type validation | ||
*************** | ||
|
||
This module provides a function ``type_validation`` that allow to effortlessly implement type validation. | ||
|
||
Description | ||
########### | ||
|
||
.. automodule:: finquant.type_utilities | ||
|
||
|
||
Code Definitions | ||
################ | ||
|
||
.. autodata:: finquant.type_utilities.type_validation | ||
:annotation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.