Fix hardcoded file paths causing "Features data file not found" errors - #4
Open
SupravoCoder with Copilot wants to merge 3 commits into
Open
Fix hardcoded file paths causing "Features data file not found" errors#4SupravoCoder with Copilot wants to merge 3 commits into
SupravoCoder with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: SupravoCoder <147735025+SupravoCoder@users.noreply.github.com>
Co-authored-by: SupravoCoder <147735025+SupravoCoder@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hardcoded file paths in Predictor_Earthquake and Susceptibility Predictor pages
Fix hardcoded file paths causing "Features data file not found" errors
Jul 12, 2025
SupravoCoder
marked this pull request as ready for review
July 13, 2025 09:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Bhukamp earthquake prediction applications were failing with "Features data file not found" errors due to hardcoded Windows-specific file paths that don't work on other systems or deployment environments.
Issues Fixed:
Predictor_Earthquake.pyandSusceptibility Predictor.pyMODELS_DIRwas pointing to a CSV file instead of a directoryChanges Made
1. Fixed Predictor_Earthquake.py
Before:
After:
2. Fixed Susceptibility Predictor.py
Before:
After:
3. Created Proper Directory Structure
4. Enhanced Error Handling
Testing
✅ Both applications now start without path errors
✅ Model loading and prediction functionality verified
✅ Cross-platform compatibility confirmed
✅ All required files properly located and accessible
Benefits
This fixes the core issue preventing the earthquake prediction applications from running in different environments.
This pull request was created as a result of the following prompt from Copilot chat.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.