This issue was found by a Codex global repository scan of tracked non-test files at commit 8c93925cb10b401b2b83c738bd9263fd74474468.
Relevant code
|
dependencies = [ |
|
"ase", |
|
"python-dotenv", |
|
"numpy", |
|
"scipy", |
|
"pydantic", |
|
"pyyaml", |
|
"SQLAlchemy[pymysql]", |
|
"tqdm", |
|
"dpdata @ git+https://github.com/deepmodeling/dpdata.git@2eadf39a901130ac1e0464e0e24f4fb9545b9e4e#egg=dpdata", |
|
"pandas", |
|
"dftd3" |
|
from pathlib import Path |
|
from typing import Optional |
|
from pydantic import BaseModel, ConfigDict |
|
from enum import Enum |
|
from abc import abstractmethod |
|
from datetime import datetime |
|
|
|
|
|
class ModelType(str, Enum): |
|
DP = "DP" |
|
ASE = "ASE" |
|
|
|
|
|
class SkipTaskType(str, Enum): |
|
DirectPredictTask = "DirectPredictTask" |
|
PropertyFinetuneTask = "PropertyFinetuneTask" |
|
CalculatorTask = "CalculatorTask" |
|
|
|
|
|
class ModelMetadata(BaseModel): |
|
model_config = ConfigDict(extra="allow") |
|
pretty_name: str |
|
def main(): |
|
results = {} |
|
leaderboard_models = get_leaderboard_models() |
|
for model in leaderboard_models: |
|
r = results[model.model_metadata.pretty_name] = process_results_for_one_model( |
|
model |
|
) |
|
# PosixPath is not JSON serializable |
|
r["model"] = json.loads( |
|
json.dumps(model.model_dump(exclude={"model_path"}), default=str) |
|
) |
Impact
The dependency is declared as bare pydantic, but the code uses Pydantic 2 APIs such as ConfigDict and model_dump(). A resolver can legally install Pydantic 1 when another package constrains it, which would make imports or runtime calls fail.
Suggested fix
Declare the intended major version explicitly, for example pydantic>=2,<3, or remove Pydantic 2-only APIs if Pydantic 1 compatibility is intended.
This issue was found by a Codex global repository scan of tracked non-test files at commit
8c93925cb10b401b2b83c738bd9263fd74474468.Relevant code
LAMBench/pyproject.toml
Lines 8 to 19 in 8c93925
LAMBench/lambench/models/basemodel.py
Lines 1 to 22 in 8c93925
LAMBench/lambench/metrics/post_process.py
Lines 180 to 190 in 8c93925
Impact
The dependency is declared as bare
pydantic, but the code uses Pydantic 2 APIs such asConfigDictandmodel_dump(). A resolver can legally install Pydantic 1 when another package constrains it, which would make imports or runtime calls fail.Suggested fix
Declare the intended major version explicitly, for example
pydantic>=2,<3, or remove Pydantic 2-only APIs if Pydantic 1 compatibility is intended.