Skip to content
Closed
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 .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Testing GitHub Actions
1 change: 0 additions & 1 deletion rmagent/agent/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from __future__ import annotations

from rmagent.rmlib.parsers.date_parser import parse_rm_date
from rmagent.rmlib.queries import QueryService


class GenealogyFormatters:
Expand Down
1 change: 1 addition & 0 deletions rmagent/cli/commands/search.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Search command - Search database by name or place."""

import re

import click
from rich.console import Console
from rich.table import Table
Expand Down
1 change: 0 additions & 1 deletion rmagent/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def completion(shell: str):
# For fish
rmagent completion fish
"""
shell_upper = shell.upper()
prog_name = "rmagent"

if shell == "zsh":
Expand Down
7 changes: 3 additions & 4 deletions rmagent/generators/biography.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

from __future__ import annotations

import time
from dataclasses import dataclass, field
from datetime import datetime, timezone
from datetime import UTC, datetime
from enum import Enum
from pathlib import Path
import time

from rmagent.agent.genealogy_agent import GenealogyAgent
from rmagent.rmlib.database import RMDatabase
Expand Down Expand Up @@ -141,7 +141,7 @@ class Biography:
sources: str

# Metadata
generated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc).astimezone())
generated_at: datetime = field(default_factory=lambda: datetime.now(UTC).astimezone())
word_count: int = 0
privacy_applied: bool = False
birth_year: int | None = None
Expand Down Expand Up @@ -1436,7 +1436,6 @@ def _generate_bibliography_from_fields(self, citation: dict) -> str:
First checks for pre-formatted Bibliography field, then constructs from individual fields.
Returns source name with WARNING only if all approaches fail.
"""
source_id = _get_row_value(citation, "SourceID", 0)
source_name = _get_row_value(citation, "SourceName", "[Unknown Source]")
fields_blob = _get_row_value(citation, "SourceFields")

Expand Down
1 change: 0 additions & 1 deletion rmagent/generators/biography/citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def _generate_bibliography_from_fields(self, citation: dict) -> str:
First checks for pre-formatted Bibliography field, then constructs from individual fields.
Returns source name with WARNING only if all approaches fail.
"""
source_id = get_row_value(citation, "SourceID", 0)
source_name = get_row_value(citation, "SourceName", "[Unknown Source]")
fields_blob = get_row_value(citation, "SourceFields")

Expand Down
4 changes: 2 additions & 2 deletions rmagent/generators/biography/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

from __future__ import annotations

import time
from datetime import datetime
from pathlib import Path
import time

from rmagent.agent.genealogy_agent import GenealogyAgent
from rmagent.rmlib.database import RMDatabase
Expand All @@ -18,6 +18,7 @@
from rmagent.rmlib.parsers.place_parser import format_place_medium, format_place_short
from rmagent.rmlib.queries import QueryService

from .citations import CitationProcessor
from .models import (
Biography,
BiographyLength,
Expand All @@ -27,7 +28,6 @@
PersonContext,
get_row_value,
)
from .citations import CitationProcessor
from .templates import BiographyTemplates


Expand Down
7 changes: 4 additions & 3 deletions rmagent/generators/biography/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
from __future__ import annotations

from dataclasses import dataclass, field
from datetime import datetime, timezone
from datetime import UTC, datetime
from enum import Enum
from pathlib import Path


class BiographyLength(str, Enum):
Expand Down Expand Up @@ -129,7 +130,7 @@ class Biography:
sources: str

# Metadata
generated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc).astimezone())
generated_at: datetime = field(default_factory=lambda: datetime.now(UTC).astimezone())
word_count: int = 0
privacy_applied: bool = False
birth_year: int | None = None
Expand All @@ -138,7 +139,7 @@ class Biography:
citation_count: int = 0
source_count: int = 0
media_files: list[dict] = field(default_factory=list) # Media files for images
media_root_directory: "Path | None" = None # Root directory for media files (replaces ? in MediaPath)
media_root_directory: Path | None = None # Root directory for media files (replaces ? in MediaPath)

def calculate_word_count(self) -> int:
"""
Expand Down
3 changes: 2 additions & 1 deletion rmagent/generators/biography/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

from __future__ import annotations

from .models import PersonContext, get_row_value
from rmagent.rmlib.parsers.date_parser import is_unknown_date, parse_rm_date
from rmagent.rmlib.parsers.name_parser import format_full_name

from .models import PersonContext, get_row_value


class BiographyTemplates:
"""Generates biography sections using templates (no AI)."""
Expand Down
2 changes: 1 addition & 1 deletion rmagent/rmlib/quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
parse_source_fields,
parse_template_field_defs,
)
from .parsers.date_parser import UNKNOWN_SORT_DATE, parse_rm_date
from .parsers.date_parser import UNKNOWN_SORT_DATE

# Numeric constants
YEAR_SECONDS = 31557600
Expand Down
4 changes: 2 additions & 2 deletions rmagent/rmlib/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def _haversine_distance(lat1: float, lon1: float, lat2: float, lon2: float) -> f
import math

# Earth radius in kilometers
R = 6371.0
earth_radius_km = 6371.0

# Convert degrees to radians
lat1_rad = math.radians(lat1)
Expand All @@ -577,5 +577,5 @@ def _haversine_distance(lat1: float, lon1: float, lat2: float, lon2: float) -> f
)
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))

distance = R * c
distance = earth_radius_km * c
return distance
3 changes: 0 additions & 3 deletions tests/unit/test_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@

from __future__ import annotations

from collections.abc import Iterable
from pathlib import Path

import pytest

# Ensure repository root is available on sys.path when running with pytest -o addopts=''
PROJECT_ROOT = Path(__file__).resolve().parents[2]
import sys
Expand Down
Loading