Skip to content

Commit

Permalink
fixed some locations, remove Ho2Sn2O7, update to follow tiled dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceravel committed Aug 1, 2023
1 parent dddada8 commit 7fb3fc2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 55 deletions.
27 changes: 9 additions & 18 deletions BMM-standards.html
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ <h2 id="Chromium">
<td></td>
<td>ErCrO<sub>3</sub></td>
<td>Erbium Chromate</td>
<td>Er</td>
<td>Lanthanide standards wheel</td>
<td></td>
<td></td>
</tr>
Expand Down Expand Up @@ -2636,7 +2636,7 @@ <h2 id="Ruthenium">
<td></td>
<td>PtRu</td>
<td>Platinum ruthenium</td>
<td></td>
<td>5d metals wheel</td>
<td></td>
<td></td>
</tr>
Expand Down Expand Up @@ -3175,7 +3175,7 @@ <h2 id="Samarium">
<td></td>
<td>Sm<sub>2</sub>O<sub>3</sub></td>
<td>Monoclinic Samarium oxide</td>
<td></td>
<td>Lanthanide standards wheel</td>
<td></td>
<td>L<sub>3</sub> : <a href="Data/Sm/Sm-L3-Sm2O3-m.xdi">Sm-L3-Sm2O3-m.xdi</a><br>L<sub>1</sub> : <a href="Data/Sm/Sm-L1-Sm2O3-m.xdi">Sm-L1-Sm2O3-m.xdi</a></td>
</tr>
Expand Down Expand Up @@ -3406,7 +3406,7 @@ <h2 id="Dysprosium">
<td></td>
<td>DyScO<sub>3</sub></td>
<td>Dysprosium scandate</td>
<td></td>
<td>Lanthanide standards wheel</td>
<td></td>
<td>L<sub>3</sub> : <a href="Data/Dy/Dy-L3-DyScO3.xdi">Dy-L3-DyScO3.xdi</a><br>L<sub>1</sub> : <a href="Data/Dy/Dy-L1-DyScO3.xdi">Dy-L1-DyScO3.xdi</a></td>
</tr>
Expand Down Expand Up @@ -3462,15 +3462,6 @@ <h2 id="Holmium">
<td>L<sub>3</sub> : <a href="Data/Ho/Ho-L3-HolmiumOxide.xdi">Ho-L3-HolmiumOxide.xdi</a><br>L<sub>1</sub> : <a href="Data/Ho/Ho-L1-HolmiumOxide.xdi">Ho-L1-HolmiumOxide.xdi</a></td>
</tr>

<tr class=present>
<td></td>
<td>Ho<sub>2</sub>Sn<sub>2</sub>O<sub>7</sub></td>
<td>Holmium stannate</td>
<td></td>
<td></td>
<td></td>
</tr>

<tr class=present>
<td></td>
<td>Ho<sub>2</sub>TiO<sub>5</sub></td>
Expand Down Expand Up @@ -3507,7 +3498,7 @@ <h2 id="Erbium">
<tr class=present>
<td>&#10004;</td>
<td>Er<sub>2</sub>O<sub>3</sub></td>
<td>Erbium oxide</td>
<td>Erbium trioxide</td>
<td>reference wheel</td>
<td></td>
<td>L<sub>3</sub> : <a href="Data/Er/Er-L3-ErbiumOxide.xdi">Er-L3-ErbiumOxide.xdi</a><br>L<sub>1</sub> : <a href="Data/Er/Er-L1-ErbiumOxide.xdi">Er-L1-ErbiumOxide.xdi</a></td>
Expand All @@ -3517,7 +3508,7 @@ <h2 id="Erbium">
<td></td>
<td>ErCrO<sub>3</sub></td>
<td>Erbium chromate</td>
<td>Cr</td>
<td>Lanthanide standards wheel</td>
<td></td>
<td></td>
</tr>
Expand Down Expand Up @@ -3558,7 +3549,7 @@ <h2 id="Thulium">
<tr class=present>
<td>&#10004;</td>
<td>Tm<sub>2</sub>O<sub>3</sub></td>
<td>Thullium oxide</td>
<td>Thullium trioxide</td>
<td>reference wheel</td>
<td></td>
<td>L<sub>3</sub> : <a href="Data/Tm/Tm-L3-ThuliumOxide.xdi">Tm-L3-ThuliumOxide.xdi</a><br>L<sub>1</sub> : <a href="Data/Tm/Tm-L1-ThuliumOxide.xdi">Tm-L1-ThuliumOxide.xdi</a></td>
Expand Down Expand Up @@ -3600,7 +3591,7 @@ <h2 id="Ytterbium">
<tr class=present>
<td>&#10004;</td>
<td>Yb<sub>2</sub>O<sub>3</sub></td>
<td>Ytterbium oxide</td>
<td>Ytterbium trioxide</td>
<td>reference wheel</td>
<td></td>
<td>L<sub>3</sub> : <a href="Data/Yb/Yb-L3-YtterbiumOxide.xdi">Yb-L3-YtterbiumOxide.xdi</a><br>L<sub>1</sub> : <a href="Data/Yb/Yb-L1-YtterbiumOxide.xdi">Yb-L1-YtterbiumOxide.xdi</a></td>
Expand Down Expand Up @@ -3642,7 +3633,7 @@ <h2 id="Lutetium">
<tr class=present>
<td>&#10004;</td>
<td>Lu<sub>2</sub>O<sub>3</sub></td>
<td>Lutetium oxide</td>
<td>Lutetium trioxide</td>
<td>reference wheel</td>
<td></td>
<td>L<sub>3</sub> : <a href="Data/Lu/Lu-L3-LutetiumOxide.xdi">Lu-L3-LutetiumOxide.xdi</a><br>L<sub>1</sub> : <a href="Data/Lu/Lu-L1-LutetiumOxide.xdi">Lu-L1-LutetiumOxide.xdi</a></td>
Expand Down
25 changes: 9 additions & 16 deletions standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
{
"material": "ErCrO3",
"name": "Erbium Chromate",
"location": "Er",
"location": "Lanthanide standards wheel",
"refwheel": false
}
],
Expand Down Expand Up @@ -1057,7 +1057,7 @@
{
"material": "PtRu",
"name": "Platinum ruthenium",
"location": "Ru",
"location": "5d metals wheel",
"refwheel": false,
"datafile": false
},
Expand Down Expand Up @@ -1338,7 +1338,7 @@
{
"material": "Sm2O3",
"name": "monoclinic Samarium oxide",
"location": "Sm",
"location": "Lanthanide standards wheel",
"refwheel": false,
"lanthanidewheel": false,
"datafile": "Sm-L3-Sm2O3-m.xdi",
Expand Down Expand Up @@ -1471,7 +1471,7 @@
{
"material": "DyScO3",
"name": "Dysprosium scandate",
"location": "Dy",
"location": "Lanthanide standards wheel",
"refwheel": false,
"datafile": "Dy-L3-DyScO3.xdi",
"datafile2": "Dy-L1-DyScO3.xdi"
Expand Down Expand Up @@ -1502,13 +1502,6 @@
"datafile": "Ho-L3-HolmiumOxide.xdi",
"datafile2": "Ho-L1-HolmiumOxide.xdi"
},
{
"material": "Ho2Sn2O7",
"name": "Holmium stannate",
"location": "Ho",
"refwheel": false,
"datafile": false
},
{
"material": "Ho2TiO5",
"name": "stuffed pyrochlore holmium titanate",
Expand All @@ -1521,7 +1514,7 @@
"Er": [
{
"material": "Er2O3",
"name": "Erbium oxide",
"name": "Erbium trioxide",
"refwheel": true,
"location": "Er",
"datafile": "Er-L3-ErbiumOxide.xdi",
Expand All @@ -1530,7 +1523,7 @@
{
"material": "ErCrO3",
"name": "Erbium chromate",
"location": "Cr",
"location": "Lanthanide standards wheel",
"refwheel": false,
"datafile": false
},
Expand All @@ -1546,7 +1539,7 @@
"Tm": [
{
"material": "Tm2O3",
"name": "Thullium oxide",
"name": "Thullium trioxide",
"refwheel": true,
"location": "Tm",
"datafile": "Tm-L3-ThuliumOxide.xdi",
Expand All @@ -1564,7 +1557,7 @@
"Yb": [
{
"material": "Yb2O3",
"name": "Ytterbium oxide",
"name": "Ytterbium trioxide",
"refwheel": true,
"location": "Yb",
"datafile2": "Yb-L1-YtterbiumOxide.xdi",
Expand All @@ -1580,7 +1573,7 @@
"Lu": [
{
"material": "Lu2O3",
"name": "lutetium oxide",
"name": "lutetium trioxide",
"refwheel": true,
"location": "Lu",
"datafile": "Lu-L3-LutetiumOxide.xdi",
Expand Down
20 changes: 13 additions & 7 deletions tiled/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
authentication:
allow_anonymous_access: true
single_user_api_key: secret
trees:
- tree: files
- tree: catalog
path: /bmm/standards
args:
directory: /home/bruce/git/bmm-standards/Data
readers_by_mimetype:
text/x-xdi: xdi:XDIDataFrameAdapter.from_file
mimetypes_by_file_ext:
.xdi: text/x-xdi

uri: catalog.db
adapters_by_mimetype:
text/x-xdi: xdi:read_xdi
# Tiled will not serve anything that is outside the directory (directories)
# listed here. It is a security feature to protect against something like
# /etc/passwd getting registered and served.
readable_storage:
- /home/bruce/git/bmm-standards/Data
writable_storage: /home/bruce/git/bmm-standards/Processed
allow_origins:
- https://vega.github.io
21 changes: 7 additions & 14 deletions tiled/xdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
import collections
import io
import re
import pathlib

import dask
import pandas as pd

from tiled.adapters.dataframe import DataFrameAdapter


def read_xdi(file):
def read_xdi(file, metadata=None, specs=None, meta=None, divisions=None, access_policy=None):
"Read XDI-formatted file given a filepath or a readable buffer."
if isinstance(file, str):
if isinstance(file, (str,pathlib.Path)):
# Treat file as filepath.
with open(file, "r") as file_:
return _read_xdi(file_)
Expand All @@ -30,6 +31,9 @@ def _read_xdi(f):
metadata = {}
fields = collections.defaultdict(dict)

#if isinstance(f, pathlib.PosixPath):
# line = f.read_text().split('\n')[0]
#else:
line = f.readline()
m = re.match(r"#\s*XDI/(\S*)\s*(\S*)?", line)
if not m:
Expand Down Expand Up @@ -86,18 +90,7 @@ def _read_xdi(f):

df = pd.read_table(f, delim_whitespace=True, names=col_labels)

return df, metadata


class XDIDataFrameAdapter(DataFrameAdapter):
specs = ["xdi"]

@classmethod
def from_file(cls, file):
df, metadata = read_xdi(file)
return cls.from_dask_dataframe(
dask.dataframe.from_pandas(df, npartitions=1), metadata=metadata
)
return DataFrameAdapter.from_pandas(df, npartitions=1, metadata=metadata, specs=["xdi"])


def write_xdi(df, metadata):
Expand Down

0 comments on commit 7fb3fc2

Please sign in to comment.