Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ jobs:
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
uses: astral-sh/setup-uv@v7
with:
python-version: 3.11
cache: 'pip'
enable-cache: "auto"

- name: Install dependencies
- name: Create venv and install dependencies
run: |
pip install -r requirements.txt
uv venv
uv pip install -r requirements.txt

- name: Run tests
run: pytest
run: uv run pytest
6 changes: 3 additions & 3 deletions parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def generate_documentation(self, module_path: str, options: Dict[str, Any]) -> s
obj.docstring.parsed = parser_func(obj.docstring)

# Handle different object types
if hasattr(obj, "members"):
# This is a class or module - parse docstrings for all methods/functions
for member_name, member in obj.members.items():
if hasattr(obj, "all_members"):
# This is a class or module - parse docstrings for all methods/functions (including inherited)
for member_name, member in obj.all_members.items():
if member.docstring:
member.docstring.parsed = parser_func(member.docstring)

Expand Down
55 changes: 55 additions & 0 deletions tests/test_coreforecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,58 @@ def test_fn_w_decorator(setup_parser):
---- | -----------
| np.ndarray: Array with the expanding statistic
"""

def test_inherited_fn(setup_parser):
inherited_fn = """::: coreforecast.lag_transforms.Lag
handler: python
options:
docstring_style: google
members:
- stack
- take
- transform
- update
heading_level: 3
show_root_heading: true
show_source: true"""
output = setup_parser.process_markdown(inherited_fn)
assert output == """### `Lag`

```python
Lag(lag)
```

Bases: <code>[\_BaseLagTransform](#coreforecast.lag_transforms._BaseLagTransform)</code>

Simple lag operator

**Parameters:**

Name | Type | Description | Default
---- | ---- | ----------- | -------
`lag` | <code>[int](#int)</code> | Number of periods to offset | *required*

#### `Lag.stack`

```python
stack(transforms)
```

#### `Lag.take`

```python
take(_idxs)
```

#### `Lag.transform`

```python
transform(ga)
```

#### `Lag.update`

```python
update(ga)
```
"""