Skip to content

Commit

Permalink
actions
Browse files Browse the repository at this point in the history
  • Loading branch information
holmrenser committed May 23, 2024
1 parent 410676c commit 51d2327
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up poetry
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Poetry install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v2

- name: Setup Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand All @@ -31,7 +31,7 @@ jobs:
# pip3 install -e .
# python -m ipykernel install --user --name=py38
- name: Set up poetry
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.3"

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Deploying to pypi:

```
poetry check
poetry version <major,minor,patch>
poetry run coverage run
poetry run coverage report
poetry version <major,minor,patch>
poetry build
poetry deploy
```
15 changes: 6 additions & 9 deletions picea/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ def __iter__(self) -> Iterable[DAGElement]:
except StopIteration:
return

def __len__(self):
return len(self._elements.keys())

@property
def elements(self) -> List[DAGElement]:
return list(self)
Expand Down Expand Up @@ -163,9 +160,9 @@ def groupby(
subclasses
"""
grouped = defaultdict(self.__class__)
for interval in self:
grouped[group_func(interval)][interval.ID] = interval
interval._container = self
for element in self:
grouped[group_func(element)][element.ID] = element
element._container = self
return grouped

def filter(
Expand All @@ -185,7 +182,7 @@ def filter(
DirectedAcyclicGraph subclass with unwanted elements removed
"""
result = self.__class__()
for interval in self:
if filter_func(interval):
result[interval.ID] = interval
for element in self:
if filter_func(element):
result[element.ID] = element
return result
4 changes: 4 additions & 0 deletions tests/tree_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def test_root(self):
deep_node = tree.loc["a"]
self.assertEqual(deep_node.root, tree)

#def test_number_of_elements(self):
# tree = Tree.from_newick(self.newick)
# self.assertEqual(10, len(tree))

"""
def test_quoted_fasttree_newick(self):
print(__file__)
Expand Down

0 comments on commit 51d2327

Please sign in to comment.