Skip to content

Commit b0b2be7

Browse files
authored
Merge pull request #228 from kayjan/version-check
build: Check python version
2 parents 7bd787e + 1025257 commit b0b2be7

File tree

4 files changed

+38
-34
lines changed

4 files changed

+38
-34
lines changed

.github/workflows/pytest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1616
fail-fast: false
1717
steps:
1818
- uses: actions/checkout@v3
1919
- name: Set up Python
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
- name: Add conda to system path
23+
- name: Check python version
2424
run: |
25-
# $CONDA is an environment variable pointing to the root of the miniconda directory
26-
echo $CONDA/bin >> $GITHUB_PATH
25+
python_version=$(python --version)
26+
echo "Python version $python_version"
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install pandas pydot Pillow

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed:
9+
- Misc: Documentation to update mkdocs-material version for social plugin.
10+
- Misc: Update links in README.
811

912
## [0.17.2] - 2024-04-24
1013
### Changed:
@@ -20,6 +23,7 @@ This will also affect showing/printing of trees when `attr_omit_null` is set to
2023
### Fixed
2124
- [#222] Tree Constructor: `dataframe_to_tree_by_relation` duplicate root node name error message to handle
2225
different data types.
26+
- Misc: Update links in README.
2327

2428
## [0.17.0] - 2024-04-04
2529
### Added

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ It is pythonic, making it easy to learn and extendable to many types of workflow
77
----
88

99
Related Links:
10-
- [Documentation](https://bigtree.readthedocs.io/en/latest/)
10+
- [Documentation](https://bigtree.readthedocs.io/)
1111
- [GitHub](https://github.com/kayjan/bigtree/)
1212
- Community
1313
- [Issues](https://github.com/kayjan/bigtree/issues)
1414
/ [Discussions](https://github.com/kayjan/bigtree/discussions)
1515
/ [Changelog](https://github.com/kayjan/bigtree/blob/master/CHANGELOG.md)
16-
/ [Contributing](https://bigtree.readthedocs.io/en/latest/contributing/)
16+
/ [Contributing](https://bigtree.readthedocs.io/en/stable/contributing/)
1717
- Package
1818
- [PyPI](https://pypi.org/project/bigtree/)
1919
/ [Conda](https://anaconda.org/conda-forge/bigtree)
@@ -29,10 +29,10 @@ There are 3 segments to Big Tree consisting of Tree, Binary Tree, and Directed A
2929

3030
For **Tree** implementation, there are 9 main components.
3131

32-
1. [**🌺 Node**](https://bigtree.readthedocs.io/en/latest/bigtree/node/)
32+
1. [**🌺 Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/)
3333
1. ``BaseNode``, extendable class
3434
2. ``Node``, BaseNode with node name attribute
35-
2. [**✨ Constructing Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/tree/construct/)
35+
2. [**✨ Constructing Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/construct/)
3636
1. From `Node`, using parent and children constructors
3737
2. From *str*, using tree display or Newick string notation
3838
3. From *list*, using paths or parent-child tuples
@@ -41,65 +41,65 @@ For **Tree** implementation, there are 9 main components.
4141
6. Add nodes to existing tree using path string
4242
7. Add nodes and attributes to existing tree using *dictionary* or *pandas DataFrame*, using path
4343
8. Add only attributes to existing tree using *dictionary* or *pandas DataFrame*, using node name
44-
3. [**➰ Traversing Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/utils/iterators/)
44+
3. [**➰ Traversing Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)
4545
1. Pre-Order Traversal
4646
2. Post-Order Traversal
4747
3. Level-Order Traversal
4848
4. Level-Order-Group Traversal
4949
5. ZigZag Traversal
5050
6. ZigZag-Group Traversal
51-
4. [**📝 Modifying Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/tree/modify/)
51+
4. [**📝 Modifying Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/modify/)
5252
1. Copy nodes from location to destination
5353
2. Shift nodes from location to destination
5454
3. Shift and replace nodes from location to destination
5555
4. Copy nodes from one tree to another
5656
5. Copy and replace nodes from one tree to another
57-
5. [**🔍 Tree Search**](https://bigtree.readthedocs.io/en/latest/bigtree/tree/search/)
57+
5. [**🔍 Tree Search**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/search/)
5858
1. Find multiple nodes based on name, partial path, relative path, attribute value, user-defined condition
5959
2. Find single nodes based on name, partial path, relative path, full path, attribute value, user-defined condition
6060
3. Find multiple child nodes based on user-defined condition
6161
4. Find single child node based on name, user-defined condition
62-
6. [**🔧 Helper Function**](https://bigtree.readthedocs.io/en/latest/bigtree/tree/helper/)
62+
6. [**🔧 Helper Function**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/helper/)
6363
1. Cloning tree to another `Node` type
6464
2. Get subtree (smaller tree with different root)
6565
3. Prune tree (smaller tree with same root)
6666
4. Get difference between two trees
67-
7. [**📊 Plotting Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/utils/plot/)
67+
7. [**📊 Plotting Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/plot/)
6868
1. Enhanced Reingold Tilford Algorithm to retrieve (x, y) coordinates for a tree structure
69-
8. [**🔨 Exporting Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/tree/export/)
69+
8. [**🔨 Exporting Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/export/)
7070
1. Print to console, in vertical or horizontal orientation
7171
2. Export to *Newick string notation*, *dictionary*, *nested dictionary*, or *pandas DataFrame*
7272
3. Export tree to *dot* (can save to .dot, .png, .svg, .jpeg files)
7373
4. Export tree to *Pillow* (can save to .png, .jpg)
7474
5. Export tree to *Mermaid Flowchart* (can display on .md)
75-
9. [**✔️ Workflows**](https://bigtree.readthedocs.io/en/latest/demo/workflow/)
75+
9. [**✔️ Workflows**](https://bigtree.readthedocs.io/en/stable/demo/workflow/)
7676
1. Sample workflows for tree demonstration!
7777

7878
--------
7979

8080
For **Binary Tree** implementation, there are 3 main components.
8181
Binary Node inherits from Node, so the components in Tree implementation are also available in Binary Tree.
8282

83-
1. [**🌿 Node**](https://bigtree.readthedocs.io/en/latest/bigtree/node/)
83+
1. [**🌿 Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/)
8484
1. ``BinaryNode``, Node with binary tree rules
85-
2. [**✨ Constructing Binary Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/binarytree/construct/)
85+
2. [**✨ Constructing Binary Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/binarytree/construct/)
8686
1. From *list*, using flattened list structure
87-
3. [**➰ Traversing Binary Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/utils/iterators/)
87+
3. [**➰ Traversing Binary Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)
8888
1. In-Order Traversal
8989

9090
-----
9191

9292
For **Directed Acyclic Graph (DAG)** implementation, there are 4 main components.
9393

94-
1. [**🌼 Node**](https://bigtree.readthedocs.io/en/latest/bigtree/node/)
94+
1. [**🌼 Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/)
9595
1. ``DAGNode``, extendable class for constructing Directed Acyclic Graph (DAG)
96-
2. [**✨ Constructing DAG**](https://bigtree.readthedocs.io/en/latest/bigtree/dag/construct/)
96+
2. [**✨ Constructing DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/dag/construct/)
9797
1. From *list*, containing parent-child tuples
9898
2. From *nested dictionary*
9999
3. From *pandas DataFrame*
100-
3. [**➰ Traversing DAG**](https://bigtree.readthedocs.io/en/latest/bigtree/utils/iterators/)
100+
3. [**➰ Traversing DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)
101101
1. Generic traversal method
102-
4. [**🔨 Exporting DAG**](https://bigtree.readthedocs.io/en/latest/bigtree/dag/export/)
102+
4. [**🔨 Exporting DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/dag/export/)
103103
1. Export to *list*, *dictionary*, or *pandas DataFrame*
104104
2. Export DAG to *dot* (can save to .dot, .png, .svg, .jpeg files)
105105

tests/dag/test_construct.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import unittest
23

34
import pandas as pd
@@ -203,18 +204,17 @@ def test_dataframe_to_dag_zero_attribute():
203204
dag = dataframe_to_dag(data)
204205
assert_dag_structure_root(dag)
205206
for parent, _ in dag_iterator(dag):
206-
match parent.name:
207-
case "a":
208-
assert hasattr(
209-
parent, "value"
210-
), "Check a attribute, expected value attribute"
211-
assert parent.value == 0, "Check a value, expected 0"
212-
case "b":
213-
assert not hasattr(
214-
parent, "value"
215-
), "Check b attribute, expected no value attribute"
216-
case "c":
217-
assert parent.value == -1, "Check c value, expected -1"
207+
if parent.name == "a":
208+
assert hasattr(
209+
parent, "value"
210+
), "Check a attribute, expected value attribute"
211+
assert parent.value == 0, "Check a value, expected 0"
212+
elif parent.name == "b":
213+
assert not hasattr(
214+
parent, "value"
215+
), "Check b attribute, expected no value attribute"
216+
elif parent.name == "c":
217+
assert parent.value == -1, "Check c value, expected -1"
218218

219219
def test_dataframe_to_dag_empty_row_error(self):
220220
with pytest.raises(ValueError) as exc_info:

0 commit comments

Comments
 (0)