foundry-ml


Namefoundry-ml JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/MLMI2-CSSI/foundry
SummaryPackage to support simplified application of machine learning models to datasets in materials science
upload_time2024-08-16 23:05:42
maintainerNone
docs_urlNone
authorAristana Scourtas, KJ Schmidt, Isaac Darling, Aadit Ambadkar, Braeden Cullen, Imogen Foster, Ribhav Bose, Zoa Katok, Ethan Truelove, Ian Foster, Ben Blaiszik
requires_python>=3.7
licenseMIT License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<picture>
  <source srcset="https://raw.githubusercontent.com/MLMI2-CSSI/foundry/main/assets/foundry-white.png" height=175" media="(prefers-color-scheme: dark)">
  <img src="https://raw.githubusercontent.com/MLMI2-CSSI/foundry/main/assets/foundry-black.png" height="175">
</picture>

[![PyPI](https://img.shields.io/pypi/v/foundry_ml.svg)](https://pypi.python.org/pypi/foundry_ml)
[![Tests](https://github.com/MLMI2-CSSI/foundry/actions/workflows/tests.yml/badge.svg)](https://github.com/MLMI2-CSSI/foundry/actions/workflows/tests.yml)
[![Tests](https://github.com/MLMI2-CSSI/foundry/actions/workflows/python-publish.yml/badge.svg)](https://github.com/MLMI2-CSSI/foundry/actions/workflows/python-publish.yml)
[![NSF-1931306](https://img.shields.io/badge/NSF-1931306-blue)](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1931306&HistoricalAwards=false)
[<img src="https://img.shields.io/badge/view-documentation-blue">](https://ai-materials-and-chemistry.gitbook.io/foundry/)


Foundry-ML simplifies the discovery and usage of ML-ready datasets in materials science and chemistry providing a simple API to access even complex datasets. 
* Load ML-ready data with just a few lines of code
* Work with datasets in local or cloud environments. 
* Publish your own datasets with Foundry to promote community usage
* (in progress) Run published ML models without hassle

Learn more and see our available datasets on [Foundry-ML.org](https://foundry-ml.org/)



# Documentation
Information on how to install and use Foundry is available in our documentation [here](https://ai-materials-and-chemistry.gitbook.io/foundry/v/docs/).

DLHub documentation for model publication and running information can be found [here](https://dlhub-sdk.readthedocs.io/en/latest/servable-publication.html).

# Quick Start
Install Foundry-ML via command line with:
`pip install foundry_ml`

You can use the following code to import and instantiate Foundry-ML, then load a dataset.

```python
from foundry import Foundry
f = Foundry(index="mdf")


f = f.load("10.18126/e73h-3w6n", globus=True)
```
*NOTE*: If you run locally and don't want to install the [Globus Connect Personal endpoint](https://www.globus.org/globus-connect-personal), just set the `globus=False`.

If running this code in a notebook, a table of metadata for the dataset will appear:

<img width="903" alt="metadata" src="https://user-images.githubusercontent.com/16869564/197038472-0b6ae559-4a6b-4b20-88e5-679bb6eb4f5c.png">

We can use the data with `f.load_data()` and specifying splits such as `train` for different segments of the dataset, then use matplotlib to visualize it.

```python
res = f.load_data()

imgs = res['train']['input']['imgs']
desc = res['train']['input']['metadata']
coords = res['train']['target']['coords']

n_images = 3
offset = 150
key_list = list(res['train']['input']['imgs'].keys())[0+offset:n_images+offset]

fig, axs = plt.subplots(1, n_images, figsize=(20,20))
for i in range(n_images):
    axs[i].imshow(imgs[key_list[i]])
    axs[i].scatter(coords[key_list[i]][:,0], coords[key_list[i]][:,1], s = 20, c = 'r', alpha=0.5)
```
<img width="595" alt="Screen Shot 2022-10-20 at 2 22 43 PM" src="https://user-images.githubusercontent.com/16869564/197039252-6d9c78ba-dc09-4037-aac2-d6f7e8b46851.png">

[See full examples](./examples)

# Contributing
Foundry is an Open Source project and we encourage contributions from the community. To contribute, please fork from the `main` branch and open a Pull Request on the `main` branch. A member of our team will review your PR shortly.

## Developer notes
In order to enforce consistency with external schemas for the metadata and datacite structures ([contained in the MDF data schema repository](https://github.com/materials-data-facility/data-schemas)) the `dc_model.py` and `project_model.py` pydantic data models (found in the `foundry/jsonschema_models` folder) were generated using the [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator/) tool. In order to ensure compliance with the flake8 linting, the `--use-annoted` flag was passed to ensure regex patterns in `dc_model.py` were specified using pydantic's `Annotated` type vs the soon to be deprecated `constr` type. The command used to run the datamodel-code-generator looks like:
```
datamodel-codegen --input dc.json --output dc_model.py --use-annotated
```

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

# Other Support
Foundry-ML brings together many components in the materials data ecosystem. Including [MAST-ML](https://mastmldocs.readthedocs.io/en/latest/), the [Data and Learning Hub for Science](https://www.dlhub.org) (DLHub), and the [Materials Data Facility](https://materialsdatafacility.org) (MDF).

## MAST-ML
This work was supported by the National Science Foundation (NSF) SI2 award No. 1148011 and DMREF award number DMR-1332851

## The Data and Learning Hub for Science (DLHub)
This material is based upon work supported by Laboratory Directed Research and Development (LDRD) funding from Argonne National Laboratory, provided by the Director, Office of Science, of the U.S. Department of Energy under Contract No. DE-AC02-06CH11357.
https://www.dlhub.org

## The Materials Data Facility
This work was performed under financial assistance award 70NANB14H012 from U.S. Department of Commerce, National Institute of Standards and Technology as part of the [Center for Hierarchical Material Design (CHiMaD)](http://chimad.northwestern.edu). This work was performed under the following financial assistance award 70NANB19H005 from U.S. Department of Commerce, National Institute of Standards and Technology as part of the Center for Hierarchical Materials Design (CHiMaD). This work was also supported by the National Science Foundation as part of the [Midwest Big Data Hub](http://midwestbigdatahub.org) under NSF Award Number: 1636950 "BD Spokes: SPOKE: MIDWEST: Collaborative: Integrative Materials Design (IMaD): Leverage, Innovate, and Disseminate".
https://www.materialsdatafacility.org

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MLMI2-CSSI/foundry",
    "name": "foundry-ml",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Aristana Scourtas, KJ Schmidt, Isaac Darling, Aadit Ambadkar, Braeden Cullen, Imogen Foster, Ribhav Bose, Zoa Katok, Ethan Truelove, Ian Foster, Ben Blaiszik",
    "author_email": "blaiszik@uchicago.edu",
    "download_url": "https://files.pythonhosted.org/packages/ad/81/9006762abea652d8f192321f2378b1c9782acfd3c0587f338a485b923f4f/foundry_ml-1.0.4.tar.gz",
    "platform": null,
    "description": "\n<picture>\n  <source srcset=\"https://raw.githubusercontent.com/MLMI2-CSSI/foundry/main/assets/foundry-white.png\" height=175\" media=\"(prefers-color-scheme: dark)\">\n  <img src=\"https://raw.githubusercontent.com/MLMI2-CSSI/foundry/main/assets/foundry-black.png\" height=\"175\">\n</picture>\n\n[![PyPI](https://img.shields.io/pypi/v/foundry_ml.svg)](https://pypi.python.org/pypi/foundry_ml)\n[![Tests](https://github.com/MLMI2-CSSI/foundry/actions/workflows/tests.yml/badge.svg)](https://github.com/MLMI2-CSSI/foundry/actions/workflows/tests.yml)\n[![Tests](https://github.com/MLMI2-CSSI/foundry/actions/workflows/python-publish.yml/badge.svg)](https://github.com/MLMI2-CSSI/foundry/actions/workflows/python-publish.yml)\n[![NSF-1931306](https://img.shields.io/badge/NSF-1931306-blue)](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1931306&HistoricalAwards=false)\n[<img src=\"https://img.shields.io/badge/view-documentation-blue\">](https://ai-materials-and-chemistry.gitbook.io/foundry/)\n\n\nFoundry-ML simplifies the discovery and usage of ML-ready datasets in materials science and chemistry providing a simple API to access even complex datasets. \n* Load ML-ready data with just a few lines of code\n* Work with datasets in local or cloud environments. \n* Publish your own datasets with Foundry to promote community usage\n* (in progress) Run published ML models without hassle\n\nLearn more and see our available datasets on [Foundry-ML.org](https://foundry-ml.org/)\n\n\n\n# Documentation\nInformation on how to install and use Foundry is available in our documentation [here](https://ai-materials-and-chemistry.gitbook.io/foundry/v/docs/).\n\nDLHub documentation for model publication and running information can be found [here](https://dlhub-sdk.readthedocs.io/en/latest/servable-publication.html).\n\n# Quick Start\nInstall Foundry-ML via command line with:\n`pip install foundry_ml`\n\nYou can use the following code to import and instantiate Foundry-ML, then load a dataset.\n\n```python\nfrom foundry import Foundry\nf = Foundry(index=\"mdf\")\n\n\nf = f.load(\"10.18126/e73h-3w6n\", globus=True)\n```\n*NOTE*: If you run locally and don't want to install the [Globus Connect Personal endpoint](https://www.globus.org/globus-connect-personal), just set the `globus=False`.\n\nIf running this code in a notebook, a table of metadata for the dataset will appear:\n\n<img width=\"903\" alt=\"metadata\" src=\"https://user-images.githubusercontent.com/16869564/197038472-0b6ae559-4a6b-4b20-88e5-679bb6eb4f5c.png\">\n\nWe can use the data with `f.load_data()` and specifying splits such as `train` for different segments of the dataset, then use matplotlib to visualize it.\n\n```python\nres = f.load_data()\n\nimgs = res['train']['input']['imgs']\ndesc = res['train']['input']['metadata']\ncoords = res['train']['target']['coords']\n\nn_images = 3\noffset = 150\nkey_list = list(res['train']['input']['imgs'].keys())[0+offset:n_images+offset]\n\nfig, axs = plt.subplots(1, n_images, figsize=(20,20))\nfor i in range(n_images):\n    axs[i].imshow(imgs[key_list[i]])\n    axs[i].scatter(coords[key_list[i]][:,0], coords[key_list[i]][:,1], s = 20, c = 'r', alpha=0.5)\n```\n<img width=\"595\" alt=\"Screen Shot 2022-10-20 at 2 22 43 PM\" src=\"https://user-images.githubusercontent.com/16869564/197039252-6d9c78ba-dc09-4037-aac2-d6f7e8b46851.png\">\n\n[See full examples](./examples)\n\n# Contributing\nFoundry is an Open Source project and we encourage contributions from the community. To contribute, please fork from the `main` branch and open a Pull Request on the `main` branch. A member of our team will review your PR shortly.\n\n## Developer notes\nIn order to enforce consistency with external schemas for the metadata and datacite structures ([contained in the MDF data schema repository](https://github.com/materials-data-facility/data-schemas)) the `dc_model.py` and `project_model.py` pydantic data models (found in the `foundry/jsonschema_models` folder) were generated using the [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator/) tool. In order to ensure compliance with the flake8 linting, the `--use-annoted` flag was passed to ensure regex patterns in `dc_model.py` were specified using pydantic's `Annotated` type vs the soon to be deprecated `constr` type. The command used to run the datamodel-code-generator looks like:\n```\ndatamodel-codegen --input dc.json --output dc_model.py --use-annotated\n```\n\n# Primary Support\nThis work was supported by the National Science Foundation under NSF Award Number: 1931306 \"Collaborative Research: Framework: Machine Learning Materials Innovation Infrastructure\".\n\n# Other Support\nFoundry-ML brings together many components in the materials data ecosystem. Including [MAST-ML](https://mastmldocs.readthedocs.io/en/latest/), the [Data and Learning Hub for Science](https://www.dlhub.org) (DLHub), and the [Materials Data Facility](https://materialsdatafacility.org) (MDF).\n\n## MAST-ML\nThis work was supported by the National Science Foundation (NSF) SI2 award No. 1148011 and DMREF award number DMR-1332851\n\n## The Data and Learning Hub for Science (DLHub)\nThis material is based upon work supported by Laboratory Directed Research and Development (LDRD) funding from Argonne National Laboratory, provided by the Director, Office of Science, of the U.S. Department of Energy under Contract No. DE-AC02-06CH11357.\nhttps://www.dlhub.org\n\n## The Materials Data Facility\nThis work was performed under financial assistance award 70NANB14H012 from U.S. Department of Commerce, National Institute of Standards and Technology as part of the [Center for Hierarchical Material Design (CHiMaD)](http://chimad.northwestern.edu). This work was performed under the following financial assistance award 70NANB19H005 from U.S. Department of Commerce, National Institute of Standards and Technology as part of the Center for Hierarchical Materials Design (CHiMaD). This work was also supported by the National Science Foundation as part of the [Midwest Big Data Hub](http://midwestbigdatahub.org) under NSF Award Number: 1636950 \"BD Spokes: SPOKE: MIDWEST: Collaborative: Integrative Materials Design (IMaD): Leverage, Innovate, and Disseminate\".\nhttps://www.materialsdatafacility.org\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Package to support simplified application of machine learning models to datasets in materials science",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/MLMI2-CSSI/foundry"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da60867285ecbcec4e8d1ec03f60e6edbe215a29c0875a24715b15cf9b7e92ef",
                "md5": "0601b668a2d6ecb5c13f4286a8e59d15",
                "sha256": "0176bb65bbea6b238a5b23cabae33528cd4453892ecb418bdbb0db0c74123610"
            },
            "downloads": -1,
            "filename": "foundry_ml-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0601b668a2d6ecb5c13f4286a8e59d15",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 42450,
            "upload_time": "2024-08-16T23:05:40",
            "upload_time_iso_8601": "2024-08-16T23:05:40.340125Z",
            "url": "https://files.pythonhosted.org/packages/da/60/867285ecbcec4e8d1ec03f60e6edbe215a29c0875a24715b15cf9b7e92ef/foundry_ml-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad819006762abea652d8f192321f2378b1c9782acfd3c0587f338a485b923f4f",
                "md5": "45480311a9f381644622bc9e32c32673",
                "sha256": "7e0126c85deb6e0ed5e4f92adbc625e35bfdfc24836aa248c04e40a50a078c39"
            },
            "downloads": -1,
            "filename": "foundry_ml-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "45480311a9f381644622bc9e32c32673",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 38110,
            "upload_time": "2024-08-16T23:05:42",
            "upload_time_iso_8601": "2024-08-16T23:05:42.030297Z",
            "url": "https://files.pythonhosted.org/packages/ad/81/9006762abea652d8f192321f2378b1c9782acfd3c0587f338a485b923f4f/foundry_ml-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-16 23:05:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MLMI2-CSSI",
    "github_project": "foundry",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "foundry-ml"
}
        
Elapsed time: 2.02866s