Skip to content

Commit fe5a236

Browse files
committed
add data to the package
1 parent def5c2d commit fe5a236

File tree

6 files changed

+6
-4
lines changed

6 files changed

+6
-4
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

environment.doc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ dependencies:
1212
- pip
1313
- pip:
1414
- sphinx-markdown-tables==0.0.17
15-
- -e .
File renamed without changes.
File renamed without changes.

qolmat/utils/data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
from qolmat.benchmark import missing_patterns
1313

14-
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
14+
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
15+
ROOT_DIR = os.path.join(CURRENT_DIR, "..")
1516

1617

1718
def read_csv_local(data_file_name: str) -> pd.DataFrame:
@@ -27,7 +28,7 @@ def read_csv_local(data_file_name: str) -> pd.DataFrame:
2728
df : pd.DataFrame
2829
dataframe
2930
"""
30-
df = pd.read_csv(f"{SCRIPT_DIR}/../../data/{data_file_name}.csv")
31+
df = pd.read_csv(os.path.join(ROOT_DIR, "data", f"{data_file_name}.csv"))
3132
return df
3233

3334

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
"Programming Language :: Python :: 3.10",
7979
]
8080

81+
PACKAGE_DATA = {"qolmat": ["data/beijing.csv", "data/conductors.csv"]}
82+
8183
setup(
8284
name=DISTNAME,
8385
version=VERSION,
@@ -96,4 +98,5 @@
9698
extras_require=EXTRAS_REQUIRE,
9799
classifiers=CLASSIFIERS,
98100
zip_safe=False,
101+
package_data=PACKAGE_DATA,
99102
)

0 commit comments

Comments
 (0)