Skip to content

Add ical_value property to vGeo#1373

Open
xxiaoxiong wants to merge 1 commit into
collective:mainfrom
xxiaoxiong:add-ical-value-vgeo
Open

Add ical_value property to vGeo#1373
xxiaoxiong wants to merge 1 commit into
collective:mainfrom
xxiaoxiong:add-ical-value-vgeo

Conversation

@xxiaoxiong
Copy link
Copy Markdown

This PR adds the ical_value property to vGeo, contributing to Issue #876.

Changes

  • Added ical_value property to vGeo (src/icalendar/prop/geo.py)
    • Returns: tuple[float, float] - A tuple of (latitude, longitude)
    • Type hint: tuple[float, float]
    • RFC reference: :rfc:5545#section-3.8.1.6
    • Includes comprehensive docstring with examples

Tests

  • Created test_vGeo.py with 4 comprehensive test cases:
    • test_ical_value_basic - Tests basic tuple return
    • test_ical_value_components - Tests latitude/longitude components
    • test_ical_value_from_ical - Tests with parsed ical strings
    • test_ical_value_negative_coordinates - Tests negative coordinates (Southern/Western hemispheres)
  • All tests pass: 4 passed

Quality Checks

  • Add type hint
  • Add docstring with RFC reference
  • Add tests for all code paths
  • Pass ruff format check
  • Pass ruff lint check
  • All tests pass

Relates to #876

- Add ical_value property with type hints and docstring
- Returns tuple of (latitude, longitude) as floats
- Add comprehensive tests for ical_value (4 test cases)
- All tests pass
- Code formatted with ruff

Relates to collective#876
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 icalendar | 🛠️ Build #32599833 | 📁 Comparing 20c5c32 against latest (7357cec)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant