Skip to content

Commit a2409b3

Browse files
blaiszikclaude
andauthored
Patch/restore mdf client (#472)
* Restore missing mdf_client.py from design-renaissance branch This file was part of PR #469 but was not included in the merge, causing ModuleNotFoundError when importing foundry. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix DOI search to return correct dataset The forge DOI search can return multiple results where only one actually has the matching DOI. Previously, get_metadata_by_doi() blindly returned the first result, which often didn't have the requested DOI. Now it iterates through results to find the one with the exact DOI match, fixing test_dataframe_search_by_doi and test_dataframe_download_by_doi tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Move torch/tensorflow to optional extras to fix CI disk space The combined size of torch, tensorflow, and NVIDIA CUDA dependencies exceeded GitHub Actions runner disk space (~4GB+). These ML frameworks are now available as optional extras via pip install .[torch] or pip install .[tensorflow]. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix flake8 linting errors - Remove unused imports (sys, rprint, Optional, pandas, numpy) - Fix unused exception variable - Remove f-string without placeholders - Split long line in MCP server description - Add noqa comment for intentional re-export Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Replace mdf_forge with internal MDFClient in tests Update test imports to use foundry.mdf_client.MDFClient instead of mdf_forge.Forge, which is no longer a required dependency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add optional extras and document installation Move heavy ML dependencies to optional extras to reduce default install size: - pip install foundry-ml[torch] - pip install foundry-ml[tensorflow] - pip install foundry-ml[huggingface] - pip install foundry-ml[excel] - pip install foundry-ml[examples] - pip install foundry-ml[dev] Update README with extras install instructions and NumPy 2.0 compatibility note. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 55ff31a commit a2409b3

2 files changed

Lines changed: 44 additions & 13 deletions

File tree

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@
2323
pip install foundry-ml
2424
```
2525

26+
Need optional integrations? Install extras only when you need them:
27+
28+
```bash
29+
pip install "foundry-ml[torch]" # Enable dataset.get_as_torch()
30+
pip install "foundry-ml[tensorflow]" # Enable dataset.get_as_tensorflow()
31+
pip install "foundry-ml[huggingface]" # Enable push-to-hub
32+
pip install "foundry-ml[excel]" # Excel import support via openpyxl
33+
```
34+
35+
> PyTorch/TensorFlow extras expect wheels compiled against NumPy 2.0. Install PyTorch 2.3+ and TensorFlow 2.18+ (or newer builds with NumPy 2 support) to avoid ABI errors.
36+
2637
```python
2738
from foundry import Foundry
2839

@@ -79,10 +90,10 @@ foundry mcp install # Add to Claude Code
7990
|---------|-------------|
8091
| Search | Find datasets by keyword, DOI, or browse catalog |
8192
| Load | Automatic download, caching, and format conversion |
82-
| PyTorch/TensorFlow | `dataset.get_as_torch()`, `dataset.get_as_tensorflow()` |
93+
| PyTorch/TensorFlow (extras) | `dataset.get_as_torch()`, `dataset.get_as_tensorflow()` |
8394
| CLI | Terminal-based workflows |
8495
| MCP Server | AI assistant integration |
85-
| HuggingFace Export | Publish to HuggingFace Hub |
96+
| HuggingFace Export (extra) | Publish to HuggingFace Hub |
8697

8798
## Available Datasets
8899

@@ -125,4 +136,4 @@ See [CONTRIBUTING.md](docs/how-to-contribute/contributing.md) for details.
125136

126137
This work was supported by the National Science Foundation under NSF Award Number: 1931306 "Collaborative Research: Framework: Machine Learning Materials Innovation Infrastructure".
127138

128-
Foundry integrates with [Materials Data Facility](https://materialsdatafacility.org), [DLHub](https://www.dlhub.org), and [MAST-ML](https://mastmldocs.readthedocs.io/).
139+
Foundry integrates with [Materials Data Facility](https://materialsdatafacility.org), [FuncX](https://www.funcx.org), and [MAST-ML](https://mastmldocs.readthedocs.io/).

setup.py

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,45 @@
1414
long_description=long_description,
1515
long_description_content_type="text/markdown",
1616
install_requires=[
17-
"mdf_toolbox>=0.6.0",
17+
"mdf_toolbox>=0.7.1",
1818
"globus-sdk>=3,<4",
19-
"dlhub_sdk>=1.0.0",
20-
"numpy>=1.15.4",
21-
"pandas>=0.23.4",
22-
"pydantic>=2.7.2",
2319
"mdf_connect_client>=0.5.0",
24-
"h5py>=2.10.0",
25-
"json2table",
26-
"openpyxl>=3.1.0",
20+
"requests>=2.31.0",
21+
"tqdm>=4.66.0",
22+
"numpy>=2.0.0",
23+
"pandas>=2.2.2",
24+
"h5py>=3.11.0",
25+
"pydantic>=2.7.2",
26+
"json2table>=1.1.5",
2727
# CLI and agent support (core)
28-
"typer[all]>=0.9.0",
29-
"rich>=13.0.0",
28+
"typer>=0.12.0",
29+
"rich>=13.7.0",
3030
],
3131
extras_require={
32+
"torch": [
33+
"torch>=2.1.0",
34+
],
35+
"tensorflow": [
36+
"tensorflow>=2.12.0",
37+
],
38+
"excel": [
39+
"openpyxl>=3.1.0",
40+
],
3241
"huggingface": [
3342
"datasets>=2.14.0",
3443
"huggingface_hub>=0.17.0",
3544
],
45+
"examples": [
46+
"scikit-learn>=1.4.0",
47+
],
48+
"dev": [
49+
"pytest>=7.4",
50+
"pytest-cov>=4.1",
51+
"pytest-mock>=3.12",
52+
"flake8>=7.0",
53+
"jsonschema>=4.19",
54+
"mock>=5.1",
55+
],
3656
},
3757
entry_points={
3858
"console_scripts": [

0 commit comments

Comments
 (0)