diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 170378a..701e360 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -4,20 +4,20 @@ on: [push, pull_request]
jobs:
test-documentation:
runs-on: ubuntu-latest
- strategy:
- matrix:
- python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- - name: Set up Python ${{ matrix.python-version }}
+
+ - name: Set up Python 3.10
uses: actions/setup-python@v4
with:
- python-version: ${{ matrix.python-version }}
+ python-version: "3.10"
+
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
+
- name: Verify documentation
run: |
sphinx-apidoc -o docs src/
diff --git a/README.rst b/README.rst
index 984a526..b0a7daf 100644
--- a/README.rst
+++ b/README.rst
@@ -6,7 +6,7 @@ debater.py
.. image:: https://badgen.net/github/license/daankoning/debater.py?
:target: https://github.com/daankoning/debater.py/blob/main/LICENSE
-.. image:: https://readthedocs.org/projects/debaterpy/badge/?version=latest
+.. image:: https://readthedocs.org/projects/debaterpy/badge/?version=stable
:target: https://debaterpy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
@@ -47,4 +47,4 @@ in order to get a speaker's average speaks in rounds where their team won, do:
Documentation
*************
-The documentation lives in the ``docs`` directory as well as on `ReadTheDocs `_.
+The documentation lives in the ``docs`` directory as well as on `ReadTheDocs `_.
diff --git a/pyproject.toml b/pyproject.toml
index 07959a0..d38d155 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "debaterpy"
-version = "0.1.0"
+version = "0.1.1"
authors = [
{ name="Daan Olivier Koning", email="daanolivierkoning@gmail.com" },
]
@@ -23,4 +23,4 @@ keywords = [
]
[project.urls]
"Homepage" = "https://github.com/daankoning/debater.py"
-"Documentation" = "https://debaterpy.readthedocs.io/en/latest/"
\ No newline at end of file
+"Documentation" = "https://debaterpy.readthedocs.io/en/latest/"
diff --git a/src/debaterpy/structures.py b/src/debaterpy/structures.py
index 4adec51..17c6d55 100644
--- a/src/debaterpy/structures.py
+++ b/src/debaterpy/structures.py
@@ -35,7 +35,7 @@ def from_json(cls, data: str) -> Item:
return cls.from_dict(json.loads(data))
@classmethod
- def from_dict(self, data: dict) -> Item:
+ def from_dict(cls, data: dict) -> Item:
"""instantiate a new object based on the dictionary ``data``. """
raise NotImplementedError
@@ -77,7 +77,7 @@ def from_dict(cls, data: dict) -> Tournament:
format=data.get("format"),
broke=data.get("broke"),
break_categories=data.get("break_categories"),
- rounds=[Round.from_dict(round) for round in data.get("rounds", [])]
+ rounds=[Round.from_dict(debate) for debate in data.get("rounds", [])]
)
diff --git a/src/debaterpy/utils.py b/src/debaterpy/utils.py
index aa8d136..5258395 100644
--- a/src/debaterpy/utils.py
+++ b/src/debaterpy/utils.py
@@ -22,9 +22,9 @@ def get_all_rounds(record: Record, function: Callable[[Tournament, Round], bool]
function: A callable returning a boolean which needs to be true for a record to be included. Receives instances
of ``structures.Tournament`` and ``structures.Round``as arguments. Will default to including all rounds."""
for tournament in record.tournaments:
- for round in tournament.rounds:
- if function(tournament, round):
- yield round
+ for debate in tournament.rounds:
+ if function(tournament, debate):
+ yield debate
def get_all_speeches(record: Record, function: Callable[[Tournament, Round, Speech], bool] = lambda x, y, z: True)\
@@ -40,9 +40,9 @@ def get_all_speeches(record: Record, function: Callable[[Tournament, Round, Spee
of ``structures.Tournament``, ``structures.Round``, and ``structures.Speech`` as arguments. Will default to
including all speeches."""
for tournament in record.tournaments:
- for round in tournament.rounds:
- for speech in round.speeches:
- if function(tournament, round, speech):
+ for debate in tournament.rounds:
+ for speech in debate.speeches:
+ if function(tournament, debate, speech):
yield speech
@@ -78,27 +78,27 @@ def generate_csv(record: Record, target: io.TextIOWrapper):
"outround_category", "prepped", "date", "date_string", "topics", "motion", "infoslide", "side",
"half", "teammates", "speech", "result", "speak", "advanced"])
for tournament in record.tournaments:
- for round in tournament.rounds:
- for speech in round.speeches:
+ for debate in tournament.rounds:
+ for speech in debate.speeches:
writer.writerow(map(str, [
tournament.tournament_name,
tournament.format,
tournament.broke,
tournament.break_categories,
- round.name,
- round.outround,
- round.outround_category,
- round.prepped,
- str(round.date.timestamp()),
- round.date.strftime("%d-%m-%Y"),
- round.topics,
- round.motion,
- round.infoslide,
- round.side,
- round.half,
- round.teammates,
+ debate.name,
+ debate.outround,
+ debate.outround_category,
+ debate.prepped,
+ str(debate.date.timestamp()),
+ debate.date.strftime("%d-%m-%Y"),
+ debate.topics,
+ debate.motion,
+ debate.infoslide,
+ debate.side,
+ debate.half,
+ debate.teammates,
speech.speech,
- round.result,
+ debate.result,
speech.speak,
- round.advanced
+ debate.advanced
]))