Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indent for docs #325

Merged
merged 2 commits into from
Nov 8, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Misc: Standardise testing fixtures.
### Fixed:
- Misc: Polars set up to work on laptop with M1 chip.
- Misc: Indentation in documentation.
- Tree Export: Mermaid diagram title to add newline.
- Tree Export: Polars unit test to work with old (<=1.9.0) and new polars version.
- Tree Helper: Get tree diff string replacement bug when the path change is substring of another path.
Expand Down
25 changes: 15 additions & 10 deletions bigtree/tree/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def prune_tree(
│ └── d
└── e

# Prune tree
Prune tree

>>> root_pruned = prune_tree(root, "a/b")
>>> root_pruned.show()
Expand All @@ -165,14 +165,14 @@ def prune_tree(
├── c
└── d

## Exact path
Prune by exact path

>>> root_pruned = prune_tree(root, "a/b", exact=True)
>>> root_pruned.show()
a
└── b

## Multiple paths
Prune by multiple paths

>>> root_pruned = prune_tree(root, ["a/b/d", "a/e"])
>>> root_pruned.show()
Expand All @@ -181,7 +181,7 @@ def prune_tree(
│ └── d
└── e

## By depth
Prune by depth

>>> root_pruned = prune_tree(root, max_depth=2)
>>> root_pruned.show()
Expand Down Expand Up @@ -302,7 +302,8 @@ def get_tree_diff(
├── file1.doc
└── file2.doc

# Get tree differences
# Comparing tree structure

>>> tree_diff = get_tree_diff(root, root_other)
>>> tree_diff.show()
Downloads
Expand All @@ -313,7 +314,8 @@ def get_tree_diff(
│ └── photo2.jpg (-)
└── file2.doc (+)

## All differences
All differences

>>> tree_diff = get_tree_diff(root, root_other, only_diff=False)
>>> tree_diff.show()
Downloads
Expand All @@ -326,7 +328,8 @@ def get_tree_diff(
├── file1.doc
└── file2.doc (+)

## All differences with details
All differences with details

>>> tree_diff = get_tree_diff(
... root, root_other, only_diff=False, detail=True
... )
Expand All @@ -341,7 +344,8 @@ def get_tree_diff(
├── file1.doc
└── file2.doc (added)

## All differences with details on aggregated level
All differences with details on aggregated level

>>> tree_diff = get_tree_diff(
... root, root_other, only_diff=False, detail=True, aggregate=True
... )
Expand All @@ -356,7 +360,8 @@ def get_tree_diff(
├── file1.doc
└── file2.doc (added)

## Only differences with details on aggregated level
Only differences with details on aggregated level

>>> tree_diff = get_tree_diff(root, root_other, detail=True, aggregate=True)
>>> tree_diff.show()
Downloads
Expand All @@ -366,7 +371,7 @@ def get_tree_diff(
├── Trip (moved from)
└── file2.doc (added)

# Comparing tree attributes
# Comparing tree attribute

- (~) will be added to node name if there are differences in tree attributes defined in `attr_list`.
- The node's attributes will be a list of [value in `tree`, value in `other_tree`]
Expand Down
8 changes: 4 additions & 4 deletions bigtree/workflows/app_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Calendar:
- Calendar has four levels - year, month, day, and event name (with event attributes)

Examples:
*Initializing and Adding Events*
# *Initializing and Adding Events*

>>> from bigtree import Calendar
>>> calendar = Calendar("My Calendar")
Expand All @@ -33,13 +33,13 @@ class Calendar:
2023-01-01 18:00:00 - Gym
2023-01-02 18:00:00 - Gym

*Search for Events*
# *Search for Events*

>>> calendar.find_event("Gym")
2023-01-01 18:00:00 - Gym
2023-01-02 18:00:00 - Gym

*Removing Events*
# *Removing Events*

>>> import datetime as dt
>>> calendar.delete_event("Gym", dt.date(2023, 1, 1))
Expand All @@ -48,7 +48,7 @@ class Calendar:
2023-01-01 00:00:00 - Dinner (budget: 20)
2023-01-02 18:00:00 - Gym

*Export Calendar*
# *Export Calendar*

>>> calendar.to_dataframe()
path name date time budget
Expand Down
8 changes: 4 additions & 4 deletions bigtree/workflows/app_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AppToDo:
- If list name is not given, item will be assigned to a `General` list.

Examples:
*Initializing and Adding Items*
# *Initializing and Adding Items*

>>> from bigtree import AppToDo
>>> app = AppToDo("To Do App")
Expand All @@ -34,7 +34,7 @@ class AppToDo:
└── General
└── Cook

*Reorder List and Item*
# *Reorder List and Item*

>>> app.prioritize_list(list_name="General")
>>> app.show()
Expand All @@ -58,7 +58,7 @@ class AppToDo:
├── Bread [description=Urgent]
└── Milk [description=Urgent]

*Removing Items*
# *Removing Items*

>>> app.remove_item("Homework 1")
>>> app.show()
Expand All @@ -69,7 +69,7 @@ class AppToDo:
├── Bread [description=Urgent]
└── Milk [description=Urgent]

*Exporting and Importing List*
# *Exporting and Importing List*

>>> app.save("assets/docstr/list.json")
>>> app2 = AppToDo.load("assets/docstr/list.json")
Expand Down
2 changes: 1 addition & 1 deletion docs/bigtree/tree/modify.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ All other methods calls these 2 methods directly.

![Advanced Shift Example](https://github.com/kayjan/bigtree/raw/master/assets/docs/modify_advanced.png "Advanced Shift Example")

## Sample Tree Modification (Advanced)
### Sample Tree Modification (Advanced)

| Setting | Sample path in `from_paths` | Sample path in `to_paths` | Description |
|-----------------------------|-----------------------------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down
Loading