Skip to content

Commit

Permalink
code gen sphinx refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisSzeto committed Jul 23, 2024
1 parent 1591d49 commit f474369
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/code_generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
market-hour-code-generator,
Supported-Assets-Table-Code-Generator,
us-energy-indicators-code-generator,
writing-algorithm-api-reference-sphinx-code-generator,
indicator_reference_code_generator # must be after writing-algorithm-api-reference-sphinx-code-generator
writing-algorithm-api-reference-sphinx-code-generator
]

runs-on: ubuntu-20.04
Expand Down
5 changes: 1 addition & 4 deletions code-generators/indicator_reference_code_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,4 @@ def find_indicator_type(base_type):
$csharpProperties = {indicator['properties'][0]};
$pythonProperties = {indicator['py_properties'][0]};
include(DOCS_RESOURCES."/indicators/indicator-history.php");
?>""")

if __name__ == '__main__':
Generate_Indicators_Reference()
?>""")
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import shutil
from urllib.request import urlopen
from indicator_reference_code_generator import Generate_Indicators_Reference
from _code_generation_helpers import get_all_indicators, _type_conversion, extract_xml_content, title_to_dash_linked_lower_case

LEAN = "https://github.com/QuantConnect/Lean/blob/master"
Expand Down Expand Up @@ -36,9 +37,8 @@
.subsection-content { margin-left: 10px; }
</style>
'''
TYPE_ORDER = ["bool", "int", "long", "float", "single", "double", "decimal", "string", "str",
"datetime", "timespan", "timedelta", "list", "set", "ienumerable", "dictionary", "dict",
"callable", "func"]
TYPE_ORDER = ["bool", "int", "long", "float", "single", "double", "decimal", "string", "str", "datetime", "timespan", "timedelta"]
JOINT_TYPE_ORDER = ["list", "set", "ienumerable", "dictionary", "dict", "callable", "func", "action"]

DOCS_ATTR = {}
EXTRAS = {}
Expand Down Expand Up @@ -357,7 +357,7 @@ def _merge_args(old_dict, new_dict):
def _type_sorting(arg):
null = arg is None
if not null:
arg_type = arg.lower().split('[')[0].split('<')[0]
arg_type = arg.split('[')[0].split('<')[0].lower()
pyobj = "pyobject" in arg_type
try:
joint_type = JOINT_TYPE_ORDER.index(arg_type)
Expand Down Expand Up @@ -545,4 +545,5 @@ def _get_field_return(return_type_name, description, source_url, line_num, langu


if __name__ == '__main__':
render_docs()
render_docs()
Generate_Indicators_Reference()

0 comments on commit f474369

Please sign in to comment.