Skip to content

Commit 1b39e30

Browse files
authored
Merge pull request #18 from nunofachada/main
Update to v1.0.2
2 parents 35173f8 + 304b879 commit 1b39e30

File tree

11 files changed

+55
-39
lines changed

11 files changed

+55
-39
lines changed

.github/workflows/cov.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Clone repository
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
- name: Setup latest Python
1919
uses: actions/setup-python@v4
2020
with:
21-
python-version: '3.10'
21+
python-version: '3.11'
2222
- name: Install dependencies
2323
run: |
2424
pip install pip --upgrade
2525
pip install .[dev]
2626
- name: Test with pytest and create coverage report
2727
run: pytest --cov=parshift --cov-report=xml
2828
- name: Upload coverage to Codecov
29-
uses: codecov/codecov-action@v3
29+
uses: codecov/codecov-action@v4
3030
with:
31-
files: ./coverage.xml
31+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
docs:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
with:
1414
lfs: true
1515
- name: Build docs

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout package
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
- name: Install build and publish dependencies
1414
run: |
1515
pip3 install --upgrade build

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
version: ['3.8', '3.12']
19+
version: ['3.9', '3.13']
2020
os: [ubuntu-latest, windows-latest, macos-latest]
2121
steps:
2222
- name: Clone repository
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
- name: Setup latest Python
2525
uses: actions/setup-python@v4
2626
with:

docs/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ nav:
6868
- Reference: reference.md
6969
- Development: dev.md
7070

71-
copyright: Copyright &copy; 2023 Maintained by <a href="https://github.com/bdfsaraiva">Bruno D. Ferreira-Saraiva</a>.
71+
copyright: Copyright &copy; 2023-2025 Maintained by <a href="https://github.com/bdfsaraiva">Bruno D. Ferreira-Saraiva</a>.

parshift/annotation.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def conv2turns(conv_df: pd.DataFrame) -> List[Dict[str, Any]]:
125125
and conversation[turn - 1][last_col] == row[last_col]
126126
):
127127
msg_join = ". ".join(
128-
[conversation[turn - 1]["utterance"], row["utterance"]]
128+
[conversation[turn - 1]["utterance"], str(row["utterance"])]
129129
)
130130
list_id = conversation[turn - 1]["utterance_ids"] + [row["utterance_id"]]
131131
conversation[turn - 1]["utterance_ids"] = list_id
@@ -143,11 +143,13 @@ def conv2turns(conv_df: pd.DataFrame) -> List[Dict[str, Any]]:
143143
"utterance_ids": [id],
144144
"speaker_id": speaker_id,
145145
"utterance": utterance,
146-
last_col: last_col_val
147-
if last_col_val != ""
148-
and last_col_val != None
149-
and last_col_val != "None"
150-
else None,
146+
last_col: (
147+
last_col_val
148+
if last_col_val != ""
149+
and last_col_val != None
150+
and last_col_val != "None"
151+
else None
152+
),
151153
}
152154
)
153155

parshift/plotting.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
# Distributed under the MIT License (See accompanying file LICENSE or copy
33
# at http://opensource.org/licenses/MIT)
44

5+
from typing import Optional
6+
57
import matplotlib
68
import matplotlib.pyplot as plt
79
import pandas as pd
810
import squarify
911

1012
from .annotation import pshift_class
11-
from typing import Optional
1213

1314

1415
def frequency_treemap(

parshift/py.typed

Whitespace-only changes.

parshift/statistics.py

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -153,35 +153,47 @@ def cond_probs(pshift_codes: pd.DataFrame) -> pd.DataFrame:
153153
if key.split("-")[0] == "A0":
154154
if key not in ["A0-AY", "AB-A0", "AB-AY", "A0-A0"]:
155155
cond_prob[key] = {
156-
"CP": round(freq_table[key] / frequency_table_and_counts[1], 2)
157-
if frequency_table_and_counts[1] != 0
158-
else 0,
159-
"CPeTC": round(freq_table[key] / frequency_table_and_counts[3], 2)
160-
if frequency_table_and_counts[3] != 0
161-
else 0,
156+
"CP": (
157+
round(freq_table[key] / frequency_table_and_counts[1], 2)
158+
if frequency_table_and_counts[1] != 0
159+
else 0
160+
),
161+
"CPeTC": (
162+
round(freq_table[key] / frequency_table_and_counts[3], 2)
163+
if frequency_table_and_counts[3] != 0
164+
else 0
165+
),
162166
}
163167
else:
164168
cond_prob[key] = {
165-
"CP": round(freq_table[key] / frequency_table_and_counts[1], 2)
166-
if frequency_table_and_counts[1] != 0
167-
else 0,
169+
"CP": (
170+
round(freq_table[key] / frequency_table_and_counts[1], 2)
171+
if frequency_table_and_counts[1] != 0
172+
else 0
173+
),
168174
"CPeTC": "",
169175
}
170176
else:
171177
if key not in ["A0-AY", "AB-A0", "AB-AY", "A0-A0"]:
172178
cond_prob[key] = {
173-
"CP": round(freq_table[key] / frequency_table_and_counts[2], 2)
174-
if frequency_table_and_counts[2] != 0
175-
else 0,
176-
"CPeTC": round(freq_table[key] / frequency_table_and_counts[4], 2)
177-
if frequency_table_and_counts[4] != 0
178-
else 0,
179+
"CP": (
180+
round(freq_table[key] / frequency_table_and_counts[2], 2)
181+
if frequency_table_and_counts[2] != 0
182+
else 0
183+
),
184+
"CPeTC": (
185+
round(freq_table[key] / frequency_table_and_counts[4], 2)
186+
if frequency_table_and_counts[4] != 0
187+
else 0
188+
),
179189
}
180190
else:
181191
cond_prob[key] = {
182-
"CP": round(freq_table[key] / frequency_table_and_counts[2], 2)
183-
if frequency_table_and_counts[2] != 0
184-
else 0,
192+
"CP": (
193+
round(freq_table[key] / frequency_table_and_counts[2], 2)
194+
if frequency_table_and_counts[2] != 0
195+
else 0
196+
),
185197
"CPeTC": "",
186198
}
187199

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ packages = ["parshift"]
77

88
[project]
99
name = "parshift"
10-
version = "1.0.1"
10+
version = "1.0.2"
1111
description = "Python package based on Gibson's framework (2003) for turn-taking in group conversation analysis."
1212
readme = "README.md"
13-
requires-python = ">=3.8"
13+
requires-python = ">=3.9"
1414
keywords = [
1515
"python",
1616
"conversation-analysis",
@@ -62,7 +62,7 @@ norecursedirs = [
6262
testpaths = ["parshift", "tests"]
6363

6464
[tool.mypy]
65-
python_version = 3.8
65+
python_version = "3.9"
6666

6767
[[tool.mypy.overrides]]
6868
module = [ "squarify", "matplotlib", "matplotlib.pyplot"]

0 commit comments

Comments
 (0)