Skip to content

Commit 43d0863

Browse files
committed
docs: Update OpenAPI schema: Add descriptions for SID, figure_id, sample_id, and composition fields in GraphData schema.
1 parent 4d709ae commit 43d0863

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

dist/v1/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ components:
5151
GraphData:
5252
type: object
5353
properties:
54+
SID:
55+
type: string
56+
description: Starrydata unique ID (uppercase)
57+
figure_id:
58+
type: string
59+
description: Figure ID
60+
sample_id:
61+
type: string
62+
description: Sample ID
63+
composition:
64+
type: string
65+
description: Chemical composition
5466
prop_x:
5567
type: string
5668
description: Name of the property for the X axis

src/convert_units.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ def convert_units_in_json(input_path: str, output_path: str, unit_map: dict):
66
input_path: 入力jsonファイルパス
77
output_path: 出力jsonファイルパス
88
unit_map: 物理量名 -> 変換先単位の辞書
9+
10+
出力JSONには以下のフィールドが含まれます:
11+
- SID (StarrydataID, 大文字)
12+
- figure_id
13+
- sample_id
14+
- composition
15+
これらは入力JSONに既に含まれている場合、そのまま出力されます。
916
"""
1017
ureg = UnitRegistry()
1118
with open(input_path, 'r', encoding='utf-8') as f:
@@ -57,6 +64,7 @@ def js_to_iso(js_date_str):
5764
else:
5865
# エラー
5966
raise KeyError("updated_at field is missing in the input data")
67+
# (SID, figure_id, sample_id, compositionは入力にあればそのまま出力されます)
6068
with open(output_path, 'w', encoding='utf-8') as f:
6169
json.dump(data, f, ensure_ascii=False, indent=2)
6270

0 commit comments

Comments
 (0)