Skip to content

Commit fb34de5

Browse files
committed
chore: update uv files for pypi publish and adopt lazy_import in code logics
1 parent a8c8e53 commit fb34de5

5 files changed

Lines changed: 56 additions & 10 deletions

File tree

datalib/symbolic_regression.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import torch
3232
from torch.utils.data import Dataset, DataLoader
3333

34-
import pmlb
35-
3634
logger = logging.getLogger(__name__)
3735

3836
# PMLB GitHub raw URL for datasets not yet in the PyPI index
@@ -116,8 +114,12 @@ def _fetch_pmlb_data(dataset_name: str, cache_dir: str) -> pd.DataFrame:
116114
return pd.read_csv(cached_path, sep='\t', compression='gzip')
117115

118116
# Try pmlb.fetch_data (works for datasets in the PyPI index)
119-
if dataset_name in pmlb.dataset_names:
120-
return pmlb.fetch_data(dataset_name, local_cache_dir=cache_dir)
117+
try:
118+
import pmlb
119+
if dataset_name in pmlb.dataset_names:
120+
return pmlb.fetch_data(dataset_name, local_cache_dir=cache_dir)
121+
except ImportError:
122+
pass
121123

122124
# Fallback: fetch directly from PMLB GitHub
123125
url = f"{_PMLB_GITHUB_RAW}/{dataset_name}/{dataset_name}.tsv.gz"

models/md17/forcenet.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
from layers import CliffordLayerNorm
1919
from layers import BladeSelector
2020
from functional.activation import GeometricGELU, GeometricSquare
21-
from torch_geometric.nn import global_add_pool
21+
try:
22+
from torch_geometric.nn import global_add_pool
23+
except ImportError:
24+
global_add_pool = None
2225

2326

2427
class GaussianRBF(nn.Module):

pyproject.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,42 @@ version = "1.0.0"
44
description = "A PyTorch framework for Geometric Algebra Deep Learning"
55
readme = "README.md"
66
requires-python = ">=3.9"
7+
license = { file = "LICENSE" }
8+
authors = [
9+
{ name = "Eunkyum Kim", email = "nemonanconcode@gmail.com" },
10+
]
11+
keywords = [
12+
"geometric-algebra",
13+
"clifford-algebra",
14+
"deep-learning",
15+
"pytorch",
16+
"rotor",
17+
"multivector",
18+
"equivariant",
19+
]
20+
classifiers = [
21+
"Development Status :: 5 - Production/Stable",
22+
"Intended Audience :: Science/Research",
23+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
24+
"Topic :: Scientific/Engineering :: Mathematics",
25+
"License :: OSI Approved :: Apache Software License",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3.12",
31+
]
732
dependencies = [
833
"torch>=2.0.0",
934
"numpy>=1.26.0",
1035
"hydra-core>=1.3.2",
1136
"tqdm>=4.67.3",
1237
]
1338

39+
[project.urls]
40+
Homepage = "https://github.com/Concode0/Versor"
41+
Repository = "https://github.com/Concode0/Versor"
42+
1443
[project.optional-dependencies]
1544
sr = [
1645
"pmlb>=1.0.1.post3",

tasks/__init__.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
"""
66

77
from .base import BaseTask
8-
from .symbolic_regression import SRTask
9-
from .md17 import MD17Task
10-
from .lqa import LQATask
11-
from .deap_eeg import DEAPEEGTask
128

139
__all__ = [
1410
"BaseTask",
@@ -17,3 +13,19 @@
1713
"LQATask",
1814
"DEAPEEGTask",
1915
]
16+
17+
18+
def __getattr__(name):
19+
if name == "SRTask":
20+
from .symbolic_regression import SRTask
21+
return SRTask
22+
if name == "MD17Task":
23+
from .md17 import MD17Task
24+
return MD17Task
25+
if name == "LQATask":
26+
from .lqa import LQATask
27+
return LQATask
28+
if name == "DEAPEEGTask":
29+
from .deap_eeg import DEAPEEGTask
30+
return DEAPEEGTask
31+
raise AttributeError(f"module 'tasks' has no attribute {name!r}")

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)