Skip to content

Commit

Permalink
fix directory issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mdp0023 committed Apr 29, 2024
1 parent 496d34a commit 4fefa67
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
15 changes: 14 additions & 1 deletion examples/svinsight_example_Travis_County.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import sys
import os
sys.path.insert(0, '/Users/matthewpreisser/Documents/Research/Codes/SVInsight')
#sys.path.insert(0, '/Users/matthewpreisser/Documents/Research/Codes/SVInsight')

# Get the directory that contains this file
this_directory = os.path.dirname(os.path.abspath(__file__))

# one level up
dir1 = os.path.dirname(this_directory)
# two levels up
dir2 = os.path.dirname(os.path.dirname(this_directory))

# Add the root directory to sys.path
sys.path.insert(0, this_directory)
sys.path.insert(0, dir1)
sys.path.insert(0, dir2)


# import package
Expand Down
12 changes: 8 additions & 4 deletions tests/test_svinsight.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
# Get the directory that contains this file
this_directory = os.path.dirname(os.path.abspath(__file__))

# Get the root directory of your project (two levels up from this file)
root_directory = os.path.dirname(os.path.dirname(this_directory))
# one level up
dir1 = os.path.dirname(this_directory)
# two levels up
dir2 = os.path.dirname(os.path.dirname(this_directory))

# Add the root directory to sys.path
sys.path.insert(0, root_directory)
sys.path.insert(0, this_directory)
sys.path.insert(0, dir1)
sys.path.insert(0, dir2)

# import package
from SVInsight import SVInsight as svi
from svinsight import SVInsight as svi
import os
import pytest
import geopandas as gpd
Expand Down

0 comments on commit 4fefa67

Please sign in to comment.