Skip to content

Commit

Permalink
Correctly set up directory path to input data to correctly work withi…
Browse files Browse the repository at this point in the history
…n a GHA or for running locally
  • Loading branch information
bikegeek committed Feb 25, 2025
1 parent 237a20f commit 036764b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/test_mode_2d_statistics.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@

import os
import pytest
import numpy as np
import pandas as pd

import metcalcpy.util.mode_2d_ratio_statistics as m2rs
import metcalcpy.util.mode_2d_arearat_statistics as m2as


cwd = os.path.dirname(__file__)

def prepare_data(obj_type = "2d"):
"""
Prepare some data for testing mode ara rations.
This uses an existing file in test/data. A more
robust approach would be to use a real MODE export
from METviewer.
"""
file_path = "test/data/ee_av_input.data"
os.environ['TEST_DIR'] = cwd

file_path = f"{cwd}/data/ee_av_input.data"
df = pd.read_csv(file_path, sep="\t")

df["object_type"] = obj_type
Expand Down

0 comments on commit 036764b

Please sign in to comment.