Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ _static
_templates

# ipython checkpoints
docs/source/**/.ipynb_checkpoints
docs/source/**/.ipynb_checkpoints
docs/**/.ipynb_checkpoints
docs/**/.ipynb_checkpoints
docs/.ipynb_checkpoints
docs/examples/.ipynb_checkpoints
14 changes: 6 additions & 8 deletions Data/iron.yml → Data/fe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta:
comment: maybe there is something to say here
last_updated: 2020-04-28
references:
@article{curtiss2013unicorn,
'@article{curtiss2013unicorn,
author = "Curtiss, Michael and Becker, Iain and Bosman, Tudor and Doroshenko, Sergey and Grijincu, Lucian and Jackson, Tom and Kunnatur, Sandhya and Lassen, Soren and Pronin, Philip and Sankar, Sriram and others",
title = "Unicorn: A system for searching the social graph",
journal = "Proceedings of the VLDB Endowment",
Expand All @@ -15,7 +15,7 @@ meta:
year = "2013",
publisher = "VLDB Endowment",
doi = "10.14778/2536222.2536239"
}
}'
data:
thermal_conductivity:
curtiss2013unicorn:
Expand All @@ -25,11 +25,9 @@ data:
comment: some value comment here
refractive_index:
curtiss2013unicorn:
value:
wavelength:
values: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...]
arg_values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...]
arg_unit: nm
comment: maybe one can write a fit of the data here
value: [1+2j, 2+4j]
arg_value: [800]
arg_unit: nm
comment: maybe one can write a fit of the data here
unit: ''
comment: n = n' + i k
File renamed without changes.
51 changes: 51 additions & 0 deletions Data/ni.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
meta:
name: nickel
formula: Ni
last_updated: 7272181873150
description:
comment:
references:
'@article{wikipedia,
author = "Wikipedia",
title = "Nickel",
url = "https://de.wikipedia.org/wiki/Nickel"
}

@online{ri_info,
author = "refractiveindex.info",
title = "Nickel",
urls = "https://refractiveindex.info/?shelf=main&book=Ni&page=Johnson"
}'

data:
thermal_conductivity:
wikipedia:
value: 91
units: W/(mK)
ri_info:
value: 90
units: W/(mK)

molar_volume:
wikipedia:
value: 6.59e-06
units: m^3/mol

boiling_point:
wikipedia:
value: 3003.0
units: K

melting_point:
wikipedia:
value: 1728.0
units: K

refractive_index:
ri_info:
value: 1+2j
arg_value: 0.188
arg_name: Wavelength
arg_unit: �m


53 changes: 0 additions & 53 deletions Data/nickel.yml

This file was deleted.

12 changes: 12 additions & 0 deletions Data/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Material name: ''
References:
- ''
Comment: ''
Data:
- Parameter name: ''
Comment: ''
Reference number: 1
Units: []
Value names: []
Values:
- []
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# MBI Material Database Concept

Due to the general demand for collecting, storing, and exchanging material parameters, we provide a text file based solution as well as several Python scripts and GUIs to read, change, and store material parameters.
Due to the general demand for collecting, storing, and exchanging material parameters, we provide a text-file-based solution, as well as several Python scripts and GUIs to read, change, and store material parameters.

Initially, we will only support [YAML](https://en.wikipedia.org/wiki/YAML) as data source, but the general design will allow also for other data sources, such as SQL databases or other file formats, e.g. XML or JSON.
Initially, we will only support the [YAML](https://en.wikipedia.org/wiki/YAML) format as a data source, but the general design will allow also for other data sources, such as SQL databases or other file formats, e.g. XML or JSON.

## YAML Format

Expand Down Expand Up @@ -47,25 +47,25 @@ data:
```

First, there is `meta` section which holds meta-data of the material.
Most importantly, the must be references defined, in order to link paramters to them.
The `references` entrie must be a plain `bibtex` entry which can hold any type of reference and as many as necessary.
Most importantly, there must be `references` defined, in order to link paramters to them.
The `references` entry must be in plain `bibtex` format, which can hold any type of reference and as many as necessary.
Further, one must include a `last_updated` field.

In the `data` section the actual physical parameters are declared.
It is possible to have multiple values stored for a single parameter, by indexing each by a `citation_key` which must be defined above in the `meta` section.
The actual parmaters, must have `value` and `unit` as well as optional `uncertainty` and `comment`.
It is possible to have multiple values stored for a single parameter, by indexing each by a `citation_key`, which must be defined above in the `meta` section.
The actual parmaters, must have `value` and `unit` and can optionally have `uncertainty` and `comment`.

In case of a functional dependence of a parameter, the name of the `argument` must be given as new index. The actual parameter `values`, the `arg_values` and `arg_unit` are mandatory.
The `comment` is optional.
With this format even multiple functional dependencies are possible from one and the same or multiple references.

## Python Scripts

Although the YAML file format allows for human readability and does not require any programmatic access, we provide several Python modules in order to inteact with the material database.
The YAML file format allows for human readability and does not require any programmatic access.
However, we provide several Python (other languages such as MATLAB can be implemented in the future as well) modules in order to inteact with the material database:

We first stick to Python but other languages such as MATLAB can be implemented in the future as well.

We divide the modules into a `Parser` module which is dedicated for reading and writing data from and to e.g. a YAML file.
The data must be provided as a `dict` in Python with a well defined structure.
The `Parser` module is dedicated for reading and writing data from and to e.g. a YAML file.
New data must be provided as a `dict` in Python with a well-defined structure.

The `Material` module implements a class for `Material`, `Paramter`, and `References` and should allow for easy interaction in a Python script with the material database.

Expand All @@ -76,11 +76,11 @@ An example of programmatic access to the database could look like this:
```python
import material_database as md

parser = md.PyYamlParser('/my/path/to/yaml/files')
parser = md.parser.PyYamlParser('/my/path/to/yaml/files')

iron = md.Material(parser.read_from_file(iron.yaml))
iron = md.Material(parser.load('fe'), log_level=10)

print(iron.thermal_conductivity)
.. 80
print(iron.thermal_conductivity['curtisss2013unicorn'].value)
..80

```
85 changes: 52 additions & 33 deletions docs/examples/simple_test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"# configure to autoload all extension\n",
"%load_ext autoreload\n",
Expand All @@ -13,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -23,58 +32,68 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO :: base path of PyYamlParser set to: ./\n"
]
}
],
"source": [
"yaml_data_path = './'\n",
"yaml_parser = md.parser.PyYamlParser(yaml_data_path, log_level=20)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"80"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"material_data = yaml_parser.load('test_material')"
"test_material.thermal_conductivity['curtiss2013unicorn'].value"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"82"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"material_data['meta']['references']['curtiss2013unicorn']"
"test_material.thermal_conductivity['aad2015combined'].value"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"test_material = md.Material(material_data, log_level=20)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"test_material.references['curtiss2013unicorn'].dump()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"test_material.parameters['thermal_conductivity'].dump()"
]
"source": []
}
],
"metadata": {
Expand All @@ -93,7 +112,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.7.6"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ meta:
description: here is some text describing the material
comment: some comments
references:
'@article{aad2015combined,
'@article{aad2015combined,
author = {Aad, Georges and Abbott, B and Abdallah, J and Abdinov, O and Aben, R and Abolins, M and AbouZeid, OS and Abramowicz, H and Abreu, H and Abreu, R and others},
journal = {Physical review letters},
number = {19},
Expand Down
Loading