Skip to content

Commit cc29a76

Browse files
committed
Documentation and Tutorials: Update documentation and add comprehensive tutorials for all modules
1 parent f485deb commit cc29a76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2679
-201
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
hide:
3+
- toc
4+
description: "Command help: `csm-data adx-send-runnerdata`"
5+
---
6+
# adx-send-runnerdata
7+
8+
!!! info "Help command"
9+
```text
10+
--8<-- "generated/commands_help/csm-data/adx-send-runnerdata.txt"
11+
```

docs/csm-data/adx-send-scenariodata.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/csm-data/api/scenariorun-load-data.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/doc/Modelops/handlers.png

-126 KB
Binary file not shown.

docs/doc/Modelops/handlers.puml

Lines changed: 0 additions & 92 deletions
This file was deleted.

docs/pull_request.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
description: "Simple check list to follow before making a pull request"
3+
---
4+
5+
Before submitting your pull request, make sure you've completed all the necessary steps:
6+
7+
1. Code Quality
8+
- [ ] Code follows the project's style guidelines (Black formatting)
9+
- [ ] All linting checks pass
10+
- [ ] Code is well-documented with docstrings
11+
- [ ] Code is efficient and follows best practices
12+
- [ ] No unnecessary dependencies are added
13+
2. Testing
14+
- [ ] All unit tests pass
15+
- [ ] Test coverage meets or exceeds 80%
16+
- [ ] All functions have at least one test
17+
- [ ] Edge cases and error conditions are tested
18+
- [ ] Mocks are used for external services
19+
3. Documentation
20+
- [ ] API documentation is updated
21+
- [ ] Command help text is clear and comprehensive
22+
- [ ] Translation strings are added for all user-facing text
23+
- [ ] Usage examples are provided
24+
- [ ] Any necessary tutorials are created or updated
25+
4. Integration
26+
- [ ] New functionality integrates well with existing code
27+
- [ ] No breaking changes to existing APIs
28+
- [ ] Dependencies are properly specified in pyproject.toml
29+
- [ ] Command is registered in the appropriate __init__.py file
30+
5. Pull Request Description
31+
- [ ] Clear description of the changes
32+
- [ ] Explanation of why the changes are needed
33+
- [ ] Any potential issues or limitations
34+
- [ ] References to related issues or discussions

docs/scripts/generate_command_helps.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
import click
1515

16-
from cosmotech.coal.cli.main import main
16+
from cosmotech.csm_data.main import main
1717

1818
commands = {}
1919

20+
2021
def command_tree(obj, base_name):
2122
commands[base_name] = obj
2223
if isinstance(obj, click.Group):
23-
return {name: command_tree(value, f"{base_name} {name}")
24-
for name, value in obj.commands.items()}
24+
return {name: command_tree(value, f"{base_name} {name}") for name, value in obj.commands.items()}
2525

2626

27-
ansi_escape = re.compile(r'(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]')
27+
ansi_escape = re.compile(r"(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]")
2828

2929
command_tree(main, "csm-data")
3030

@@ -56,14 +56,14 @@ def command_tree(obj, base_name):
5656
with contextlib.redirect_stdout(f):
5757
cmd.get_help(ctx)
5858
f.seek(0)
59-
o = ansi_escape.sub('', "".join(f.readlines()))
59+
o = ansi_escape.sub("", "".join(f.readlines()))
6060
_md_file.write(o)
6161
if os.environ.get("DOC_GENERATE_CLI_CONTENT") is not None:
6262
doc_file = doc_folder / f"{command}.md".replace(" ", "/")
6363
parent_folder = doc_file.parent
6464
parent_folder.mkdir(parents=True, exist_ok=True)
65-
current_doc = doc_template.format(command=command,
66-
command_name=command.split(" ")[-1],
67-
command_help_path=str(target_file))
65+
current_doc = doc_template.format(
66+
command=command, command_name=command.split(" ")[-1], command_help_path=str(target_file)
67+
)
6868
with open(doc_file, "w") as _doc_file:
6969
_doc_file.write(current_doc)

docs/scripts/generate_dependencies_markdown.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44
import requirements
55

66
_md_file: IO
7-
with (mkdocs_gen_files.open("dependencies.md", "w") as _md_file,
8-
open("requirements.txt") as _req,
9-
open("requirements.doc.txt") as _doc_req,
10-
open("requirements.test.txt") as _test_req,
11-
open("requirements.extra.txt") as _extra_req):
7+
with (
8+
mkdocs_gen_files.open("dependencies.md", "w") as _md_file,
9+
open("requirements.txt") as _req,
10+
open("requirements.doc.txt") as _doc_req,
11+
open("requirements.test.txt") as _test_req,
12+
open("requirements.extra.txt") as _extra_req,
13+
open("requirements.dev.txt") as _dev_req,
14+
):
1215
content = ["# List of dependencies", ""]
1316

1417
_requirements: list[str] = _req.read().splitlines()
1518
_doc_requirements: list[str] = _doc_req.read().splitlines()
1619
_test_requirements: list[str] = _test_req.read().splitlines()
1720
_extra_requirements: list[str] = _extra_req.read().splitlines()
21+
_dev_requirements: list[str] = _dev_req.read().splitlines()
1822

19-
for _r in [_requirements, _doc_requirements, _extra_requirements, _test_requirements]:
23+
for _r in [_requirements, _doc_requirements, _extra_requirements, _test_requirements, _dev_requirements]:
2024
for _l in _r:
2125
if not _l:
2226
content.append("")
@@ -28,7 +32,7 @@
2832
content.append(
2933
f"[ ![PyPI - {_name}]"
3034
f"(https://img.shields.io/pypi/l/{_name}?style=for-the-badge&labelColor=informational&label={_name})]"
31-
f"(https://pypi.org/project/{_name}/) ")
35+
f"(https://pypi.org/project/{_name}/) "
36+
)
3237

3338
_md_file.writelines(_l + "\n" for _l in content)
34-

docs/scripts/generate_index.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import mkdocs_gen_files
44

5-
from CosmoTech_Acceleration_Library import __version__
5+
from cosmotech.coal import __version__
66

77
_md_file: IO
8-
with mkdocs_gen_files.open("index.md", "w") as _md_file, \
9-
open("docs/scripts/index.md.template") as index_template, \
10-
open("README.md") as readme:
8+
with mkdocs_gen_files.open("index.md", "w") as _md_file, open("docs/scripts/index.md.template") as index_template, open(
9+
"README.md"
10+
) as readme:
1111
_index: list[str] = index_template.readlines()
1212
_readme_content = readme.readlines()
1313
for _line in _index:
Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import os
22

33
import mkdocs_gen_files
4-
from griffe.dataclasses import Alias
5-
from griffe.dataclasses import Module
4+
from griffe import Alias
5+
from griffe import Module
66

7-
pyhand = mkdocs_gen_files.config['plugins']['mkdocstrings'].get_handler('python')
8-
module_name = 'CosmoTech_Acceleration_Library'
9-
10-
griffed_module = pyhand.collect(module_name, {})
7+
pyhand = mkdocs_gen_files.config["plugins"]["mkdocstrings"].handlers.get_handler("python")
8+
module_name = "cosmotech.coal"
9+
griffed_module = pyhand.collect(module_name, pyhand.get_options({}))
1110

1211

1312
def yield_module_member(module: Module) -> list[bool, str]:
@@ -26,36 +25,36 @@ def yield_module_member(module: Module) -> list[bool, str]:
2625
depth = 0
2726
parents = {}
2827
for is_class, identifier in yield_module_member(griffed_module):
29-
parent, *sub = identifier.rsplit('.', depth)
28+
parent, *sub = identifier.rsplit(".", depth)
3029
if is_class:
31-
parent, *sub = identifier.rsplit('.', depth + 1)
30+
parent, *sub = identifier.rsplit(".", depth + 1)
3231
parents.setdefault(parent, set())
3332
if sub:
3433
parents[parent].add(sub[0])
3534
else:
3635
parents[parent].add(parent)
3736

3837
# gen md files
39-
with open('docs/scripts/generic_ref.md.template') as f:
38+
with open("docs/scripts/generic_ref.md.template") as f:
4039
generic_template_ref = f.read()
4140

4241
mk_nav = mkdocs_gen_files.Nav()
4342
for nav, file_set in parents.items():
44-
nav_root = ['References']
45-
nav_root.extend(n for n in nav.split('.')[1:] if n)
46-
file_name = '/'.join(nav.split('.')[1:]) + '.md'
43+
nav_root = ["References"]
44+
nav_root.extend(n for n in nav.split(".")[1:] if n)
45+
file_name = "/".join(nav.split(".")[1:]) + ".md"
4746
mk_nav[nav_root] = file_name
48-
with mkdocs_gen_files.open(os.path.join('references', file_name), 'w') as f:
49-
f.write(f'# {nav}')
50-
f.write('\n')
47+
with mkdocs_gen_files.open(os.path.join("references", file_name), "w") as f:
48+
f.write(f"# {nav}")
49+
f.write("\n")
5150
for filz in sorted(file_set):
5251
_content = ""
5352
if filz != nav:
54-
_content = generic_template_ref.replace('%%IDENTIFIER%%', '.'.join([nav, filz]))
53+
_content = generic_template_ref.replace("%%IDENTIFIER%%", ".".join([nav, filz]))
5554
else:
56-
_content = generic_template_ref.replace('%%IDENTIFIER%%', filz)
55+
_content = generic_template_ref.replace("%%IDENTIFIER%%", filz)
5756
f.write(_content)
58-
f.write('\n')
57+
f.write("\n")
5958

6059
with mkdocs_gen_files.open("references/SUMMARY.md", "w") as nav_file:
6160
nav_file.writelines(mk_nav.build_literate_nav())

0 commit comments

Comments
 (0)