Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Python2 CI coverage, fix Python3 CI #95

Merged
merged 12 commits into from
Jul 10, 2023
35 changes: 0 additions & 35 deletions .github/workflows/build_and_upload_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ jobs:
with:
path: ./wheelhouse/*.whl

build_wheels_linux_27:
name: Build wheels for Python 2.7 on Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

# Neeed to use cibuildwheel 1 for Python 2.7
- uses: pypa/[email protected]
env:
CIBW_SKIP: pp*
CIBW_ARCHS_LINUX: auto
CIBW_PROJECT_REQUIRES_PYTHON: "~=2.7"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

# TODO: uncomment if/when we decide to build wheels for macOS
# build_wheels_macos_36_37:
# name: Build wheels for Python 3.6 and 3.7 on macOS
Expand Down Expand Up @@ -84,22 +67,6 @@ jobs:
# with:
# path: ./wheelhouse/*.whl

# build_wheels_macos_27:
# name: Build wheels for Python 2.7 on macOS
# runs-on: macos-12
# steps:
# - uses: actions/checkout@v3

# # Neeed to use cibuildwheel 1 for Python 2.7
# - uses: pypa/[email protected]
# env:
# CIBW_SKIP: pp*
# CIBW_BUILD: cp27-macosx_x86_64

# - uses: actions/upload-artifact@v3
# with:
# path: ./wheelhouse/*.whl

build_sdist:
name: Build sdist
runs-on: ubuntu-20.04
Expand All @@ -122,7 +89,6 @@ jobs:
- build_wheels_linux_27
# - build_wheels_macos_36_37
# - build_wheels_macos_38_plus
# - build_wheels_macos_27
- build_sdist
runs-on: ubuntu-20.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
Expand All @@ -144,7 +110,6 @@ jobs:
- build_wheels_linux_27
# - build_wheels_macos_36_37
# - build_wheels_macos_38_plus
# - build_wheels_macos_27
- build_sdist
runs-on: ubuntu-20.04
if: github.event_name == 'release' && github.event.action == 'published'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pip-install-tester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
python -m pip install --upgrade pip pytest

- name: Build Python 3 dependencies
if: ${{ matrix.python-version != 2.7 }}
run: |
python -m pip install tables

Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# https://github.com/actions/setup-python/issues/162
os: [ubuntu-20.04]
# TODO: add pypy2, pypy3
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
python-version: [3.5, 3.6, 3.7, 3.8]
exclude:
- os: macos-latest
python-version: [3.5, 3.6]
Expand All @@ -30,19 +30,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Python2.7 dependencies
if: ${{ matrix.python-version == 2.7 }}
run: |
python -m pip install --upgrade pytest numexpr==2.7.3
pip install -r requirements.txt
# Optional Dependency for HDF Checkpointing
pip install tables
python setup.py install
python setup.py build_ext --inplace
python -m pip list

- name: Install Python3 dependencies
if: ${{ matrix.python-version != 2.7 }}
run: |
python -m pip install --upgrade pip pytest
pip install -r requirements.txt
Expand Down Expand Up @@ -101,8 +89,8 @@ jobs:
echo -e "PWD:${PWD}"
which cali-query

- name: Build Timemory
if: ${{ matrix.python-version >= 3.6 }}
- name: Build Timemory for Python 3.6
if: ${{ matrix.python-version == 3.6 }}
run: |
python -m pip install --upgrade scikit-build
# python -m pip install --upgrade --no-cache-dir --no-deps -v --pre timemory --install-option=--disable-{c,gotcha,tools}
Expand All @@ -114,6 +102,7 @@ jobs:

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # @v2.1.0
if: ${{ matrix.python-version >= 3.7 }}
with:
fail_ci_if_error: true
verbose: true
Expand Down
3 changes: 3 additions & 0 deletions hatchet/readers/caliper_native_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


import pandas as pd
import numpy as np
import os

import caliperreader as cr
Expand Down Expand Up @@ -349,6 +350,7 @@ def read(self):
default_metric_dict[list(self.record_data_cols)[idx]] = 0
else:
default_metric_dict[list(self.record_data_cols)[idx]] = None
default_metric_dict["nid"] = np.nan

# create a list of dicts, one dict for each missing row
missing_nodes = []
Expand Down Expand Up @@ -440,6 +442,7 @@ def read(self):
with self.timer.phase("data frame"):
# merge the metrics and node dataframes on the nid column
dataframe = pd.merge(df_metrics, self.df_nodes, on="nid")
dataframe["nid"] = dataframe["nid"].astype(pd.Int64Dtype())

# set the index to be a MultiIndex
indices = ["node"]
Expand Down
5 changes: 3 additions & 2 deletions hatchet/tests/caliper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import subprocess
import numpy as np
import pandas as pd

import pytest
import sys
Expand Down Expand Up @@ -224,7 +225,7 @@ def test_graphframe_native_lulesh_from_file(lulesh_caliper_cali):
if col in ("time (inc)", "time"):
assert gf.dataframe[col].dtype == np.float64
elif col in ("nid", "rank"):
assert gf.dataframe[col].dtype == np.int64
assert gf.dataframe[col].dtype == pd.Int64Dtype()
elif col in ("name", "node"):
assert gf.dataframe[col].dtype == object

Expand All @@ -250,7 +251,7 @@ def test_graphframe_native_lulesh_from_caliperreader(lulesh_caliper_cali):
if col in ("time (inc)", "time"):
assert gf.dataframe[col].dtype == np.float64
elif col in ("nid", "rank"):
assert gf.dataframe[col].dtype == np.int64
assert gf.dataframe[col].dtype == pd.Int64Dtype()
elif col in ("name", "node"):
assert gf.dataframe[col].dtype == object

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"License :: OSI Approved :: MIT License",
],
keywords="",
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
python_requires=">=3.5",
packages=[
"hatchet",
"hatchet.readers",
Expand Down