Skip to content

Fix missing dynamic data on dashboard#110

Merged
skyelaird merged 1 commit intomainfrom
claude/fix-dashboard-dynamic-data-014KYRYqhRp997jyG24MgHmw
Nov 17, 2025
Merged

Fix missing dynamic data on dashboard#110
skyelaird merged 1 commit intomainfrom
claude/fix-dashboard-dynamic-data-014KYRYqhRp997jyG24MgHmw

Conversation

@skyelaird
Copy link
Copy Markdown
Owner

Implemented auto-generation feature that runs when the server starts:

What it does:

  • Checks if enhanced_predictions.json exists on startup
  • If missing: Automatically generates fresh predictions
  • If >24 hours old: Automatically regenerates (keeps data fresh)
  • If <24 hours old: Uses existing data (displays age)

New command-line flag:

  • --skip-auto-gen: Disable auto-generation if desired

User experience improvements:

  1. Dashboard now works immediately after server start (no empty screens)
  2. Data stays fresh automatically (regenerates after 24 hours)
  3. "Refresh Predictions" button still available for manual updates
  4. Clear startup messages show what's happening

Example output:

✓ Server starting on http://127.0.0.1:8000
✓ Dashboard: http://127.0.0.1:8000/
✓ Debug mode: Disabled

No prediction data found - generating initial predictions...
✓ Predictions generated successfully
  * Total predictions: 240
  * Generated: 2025-11-17T20:58:20+00:00

This fixes the issue where users had to manually run generate_predictions.py before the dashboard would display any data.

Description

A clear and concise description of what this PR does.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Test coverage improvement

Related Issues

Closes #(issue number)
Related to #(issue number)

Changes Made

  • Change 1
  • Change 2
  • Change 3

Testing

Describe the tests you've run to verify your changes:

Test Configuration

  • Python version:
  • Operating System:
  • NumPy/SciPy versions:

Test Results

# Command used to test
python -m pytest tests/

# Or validation command
python test_voacap_reference.py
  • All existing tests pass
  • New tests added for new functionality
  • Validation pass rate maintained or improved
  • No performance regression

Validation Checklist

  • Code follows PEP 8 style guidelines
  • Docstrings added/updated for public functions
  • Type hints added where appropriate
  • Comments added for complex logic
  • Documentation updated (README, USAGE, etc.)
  • CHANGELOG.md updated
  • No new warnings or errors introduced

Performance Impact

  • No performance impact
  • Performance improved (provide benchmarks)
  • Minor performance regression (justified because...)
  • Not applicable

Benchmarks (if applicable)

Before: X seconds
After: Y seconds
Change: Z% improvement/regression

Breaking Changes

If this PR introduces breaking changes, describe:

  1. What breaks
  2. Migration path for users
  3. Why this change is necessary

Screenshots/Output (if applicable)

For dashboard changes or output format changes, include before/after screenshots or sample output.

Additional Notes

Any additional information that reviewers should know:

  • Assumptions made
  • Trade-offs considered
  • Future work needed
  • Dependencies added/removed

Reviewer Checklist

For maintainers reviewing this PR:

  • Code quality is acceptable
  • Tests are comprehensive
  • Documentation is clear
  • Validation results are acceptable
  • No security issues introduced
  • Backward compatibility maintained (or breaking changes justified)

Implemented auto-generation feature that runs when the server starts:

**What it does:**
- Checks if enhanced_predictions.json exists on startup
- If missing: Automatically generates fresh predictions
- If >24 hours old: Automatically regenerates (keeps data fresh)
- If <24 hours old: Uses existing data (displays age)

**New command-line flag:**
- `--skip-auto-gen`: Disable auto-generation if desired

**User experience improvements:**
1. Dashboard now works immediately after server start (no empty screens)
2. Data stays fresh automatically (regenerates after 24 hours)
3. "Refresh Predictions" button still available for manual updates
4. Clear startup messages show what's happening

**Example output:**
```
✓ Server starting on http://127.0.0.1:8000
✓ Dashboard: http://127.0.0.1:8000/
✓ Debug mode: Disabled

No prediction data found - generating initial predictions...
✓ Predictions generated successfully
  * Total predictions: 240
  * Generated: 2025-11-17T20:58:20+00:00
```

This fixes the issue where users had to manually run generate_predictions.py
before the dashboard would display any data.
@skyelaird skyelaird merged commit 8d9c447 into main Nov 17, 2025
6 checks passed
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.

2 participants