https://github.com/exabyte-io/made

Materials Design in Javascript (made.js). A JavaScript (Node) library allowing for the creation and manipulation of material structures from atoms up on the web.

https://github.com/exabyte-io/made

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.8%) to scientific vocabulary

Keywords

atomic-design chemistry computer-aided-design crystallography javascript materials materials-design materials-informatics materials-science
Last synced: 6 months ago · JSON representation

Repository

Materials Design in Javascript (made.js). A JavaScript (Node) library allowing for the creation and manipulation of material structures from atoms up on the web.

Basic Info
Statistics
  • Stars: 7
  • Watchers: 6
  • Forks: 4
  • Open Issues: 13
  • Releases: 134
Topics
atomic-design chemistry computer-aided-design crystallography javascript materials materials-design materials-informatics materials-science
Created about 7 years ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

npm version License: Apache

Made

Made is a library for MAterials DEsign. It allows for creating and manipulating material structures from atoms up. The library is aimed to be used for the development of web applications, both on the client (web browser) and server (eg. Node.js) side. It has implementations in Python (including Pyodide) and JavaScript/TypeScript.

1. Overview

The package provides software concepts for interacting with Materials-related data structures. The concepts follow the ESSE Data Convention [1].

2. Installation

2.1. JavaScript/TypeScript

From NPM for use within a software project:

```bash npm install @mat3ra/made

```

2.2. Python

From PyPI for use within a software project:

bash pip install mat3ra-made

When willing to use the optional tools module, install the package with the following command:

bash pip install "mat3ra-made[tools]"

3. Functionality

As below

4. Contribution

This repository is an open-source work-in-progress and we welcome contributions.

We regularly deploy the latest code containing all accepted contributions online as part of the Mat3ra.com platform, so contributors will see their code in action there.

We suggest forking this repository and introducing the adjustments there to be considered for merging into this repository as explained in more details here, for example.

4.1. Source code conventions

Object-oriented design patterns encapsulate key concepts following the conventions below.

  1. Classes follow the Exabyte Data Convention and data structures defined in ESSE [1]

  2. Only materials-related code is considered. Properties related to simulation model parameters (eg. type of approximation, numerical parameters) shall go elsewhere.

  3. tools directory contains helper functions that act on one or more classes and include an external parameter. Functions that use class data without any external parameters should be implemented inside the class. For example, basis.clone() is implemented in Basis, but basis repetition is implemented as a tool in the correspondingly named function (tools/basis.js#repeat) because the repetion requires a parameter external to basis - number of repetitions in 3 spatial dimensions.

  4. [Deprecated, use mat3ra-parsers or @mat3ra/parsers] parsers directory contains the parsers to- and from- ESSE format mentioned in 1. All functionality related to external data conversion is contained in this directory.

4.2. TODO list

[Outdated] Desirable features for implementation:

  • identify primitive / conventional structures
  • support for molecular geometries
  • support for polymer geometries
  • radial correlation function calculation
  • generation of complex atomic shapes:
    • fullerene
    • nanotube
    • nanowire
    • nano-cluster
    • a combination of the above
    • arbitrary atomic arrangement

5. Development

5.1. JavaScript/TypeScript

5.1.1. Tests

Made tests are written based on Mocha 6 testing framework and can be executed as follows.

bash git pull git lfs pull to get the latest test fixtures from LFS, and then:

bash npm install npm test

5.1.2. Important Notes

  1. Keep the tests directory structure similar to the main codebase directory structure. Every JS module in the main codebase should have a corresponding module in tests directory which implements the tests for provided functionality.

  2. Add tests fixtures into fixtures directory. The fixtures are automatically stored on Git LFS 7.

  3. If the fixtures are going to be used inside multiple cases, read and export them inside enums to avoid code duplicates.

  4. Tests setup module can be used to implement the hooks that are used to prepare the tests environment.

5.1.3. Using Linter

Linter setup will prevent committing files that don't adhere to the code standard. It will attempt to fix what it can automatically prior to the commit in order to reduce diff noise. This can lead to "unexpected" behavior where a file that is staged for commit is not identical to the file that actually gets committed. This happens in the lint-staged directive of the package.json file (by using a husky pre-commit hook). For example, if you add extra whitespace to a file, stage it, and try to commit it, you will see the following:

```bash ➜ made git:(feature/SOF-4398-TB) ✗ git add src/basis/constrained_basis.js ➜ made git:(feature/SOF-4398-TB) ✗ git commit -m "Test commit non-linted code" ✔ Preparing... ✔ Running tasks... ✖ Prevented an empty git commit! ✔ Reverting to original state because of errors... ✔ Cleaning up...

⚠ lint-staged prevented an empty git commit. Use the --allow-empty option to continue, or check your task configuration

husky - pre-commit hook exited with code 1 (error) ```

The staged change may remain but will not have been committed. Then it will look like you still have a staged change to commit, but the pre-commit hook will not actually commit it for you, quite frustrating! Styling can be applied manually and fixed by running:

bash npm run lint:fix

In which case, you may need to then add the linter edits to your staging, which in the example above, puts the file back to identical with the base branch, resulting in no staged changes whatsoever.

5.1.4. Configuring WebStorm for use with Linter

In order for the WebStorm IDE to take full advantage of the linting configuration, it can be configured in the project:

  • Preferences -> Languages & Frameworks -> JavaScript -> Code Quality Tools -> ESLint
  • Check Automatic ESLint configuration which should infer all the configurations from the project directory

5.2. Python

5.2.1. Tests

Python 3.8+ is required to run the tests. We recommend using PyEnv to manage Python versions. Tests are written based on PyTest and can be executed as follows.

bash virtualenv .venv source .venv/bin/activate pip install ".[tests]" pytest tests/py

To visualize material from a debugger, run the following command in the "Evaluate expression" console:

python from mat3ra.debug_utils import debug_visualize_material; debug_visualize_material(material)

5.2.2. Important Notes

Conventions:

  • The "tools" module has external dependencies on "pymatgen" and "ase" packages and so is meant as optional. When implementing new functionality, the use of ASE is recommended over pymatgen for compatibility purposes.

5.2.3. Developing locally for pyodide

To build and serve locally, use the following command:

bash wheel_server More details can be found in the script documentation.

5.3. Known Issues

5.3.1. JavaScript/TypeScript

To be added.

5.3.2. Python

As below:

  • Python 3.8 tests are failing on Apple Silicon due to https://github.com/materialsproject/pymatgen/issues/3521

Links

  1. Exabyte Source of Schemas and Examples (ESSE), Github Repository
  2. ECMAScript 2015 Language Specifications
  3. POSCAR file format, official website
  4. XYZ file format, Wikipedia
  5. Quantum ESPRESSO, Official Website
  6. Mocha, Official Website
  7. Git LFS, Official Website

Owner

  • Name: Mat3ra.com
  • Login: Exabyte-io
  • Kind: organization
  • Email: info@mat3ra.com
  • Location: San Francisco, CA, USA

Materials R&D Cloud

GitHub Events

Total
  • Release event: 42
  • Watch event: 1
  • Delete event: 52
  • Issue comment event: 1
  • Push event: 595
  • Pull request event: 128
  • Pull request review event: 477
  • Pull request review comment event: 390
  • Fork event: 1
  • Create event: 107
Last Year
  • Release event: 42
  • Watch event: 1
  • Delete event: 52
  • Issue comment event: 1
  • Push event: 595
  • Pull request event: 128
  • Pull request review event: 477
  • Pull request review comment event: 390
  • Fork event: 1
  • Create event: 107

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 193
  • Average time to close issues: about 9 hours
  • Average time to close pull requests: about 1 month
  • Total issue authors: 2
  • Total pull request authors: 17
  • Average comments per issue: 1.5
  • Average comments per pull request: 0.12
  • Merged pull requests: 137
  • Bot issues: 0
  • Bot pull requests: 6
Past Year
  • Issues: 1
  • Pull requests: 94
  • Average time to close issues: about 8 hours
  • Average time to close pull requests: 4 days
  • Issue authors: 1
  • Pull request authors: 4
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.01
  • Merged pull requests: 69
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • blokhin (1)
  • VsevolodX (1)
Pull Request Authors
  • VsevolodX (152)
  • mohammadidinani (19)
  • adewyer (19)
  • timurbazhirov (17)
  • k0stik (12)
  • exabyte-io-bot (6)
  • tjduigna (6)
  • unsigned6 (6)
  • pranabdas (5)
  • dependabot[bot] (5)
  • azech-hqs (4)
  • AcylSilane (2)
  • radik (2)
  • Vinkersa (1)
  • seankwarren (1)
Top Labels
Issue Labels
milestone (1)
Pull Request Labels
dependencies (5) milestone (5) come-back-later (3) revisit-later (2)

Packages

  • Total packages: 1
  • Total downloads:
    • npm 1,114 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 99
  • Total maintainers: 1
npmjs.org: @mat3ra/made

MAterials DEsign library

  • Versions: 99
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,114 Last month
Rankings
Dependent repos count: 32.3%
Average: 39.3%
Dependent packages count: 46.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

package-lock.json npm
  • 570 dependencies
package.json npm
  • @exabyte-io/code.js 2022.6.15-1 development
  • chai ^4.3.4 development
  • chai-almost ^1.0.1 development
  • eslint ^7.32.0 development
  • eslint-config-airbnb ^19.0.2 development
  • eslint-config-prettier ^8.3.0 development
  • eslint-plugin-import ^2.25.3 development
  • eslint-plugin-jsdoc ^37.1.0 development
  • eslint-plugin-jsx-a11y ^6.5.1 development
  • eslint-plugin-prettier ^4.0.0 development
  • eslint-plugin-react ^7.27.1 development
  • eslint-plugin-react-hooks ^4.3.0 development
  • eslint-plugin-simple-import-sort ^7.0.0 development
  • husky ^7.0.4 development
  • lint-staged ^12.1.2 development
  • mocha ^9.1.3 development
  • nyc ^15.1.0 development
  • prettier ^2.5.1 development
  • @babel/cli ^7.16.0
  • @babel/core ^7.16.0
  • @babel/eslint-parser ^7.16.3
  • @babel/plugin-proposal-class-properties ^7.16.0
  • @babel/preset-env ^7.16.4
  • @babel/register ^7.16.0
  • @exabyte-io/periodic-table.js 2022.5.5-2
  • array-almost-equal ^1.0.0
  • crypto-js ^3.1.9-1
  • lodash ^4.17.4
  • mathjs ^3.9.0
  • mixwith ^0.1.1
  • underscore ^1.8.3
  • underscore.string ^3.3.4
.github/workflows/cicd.yml actions
  • ./actions/js/publish * composite
  • ./actions/js/test * composite
  • actions/checkout v2 composite