-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update parsing of system definitions for table
move existing table to a legacy catalog of systems
- Loading branch information
Showing
6 changed files
with
107 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import glob | ||
|
||
import pandas as pd | ||
import yaml | ||
|
||
|
||
def main(): | ||
sysconfig_yaml_files = glob.glob( | ||
"../legacy/systems/**/system_definition.yaml", recursive=True | ||
) | ||
|
||
df_list = [] | ||
for f in sysconfig_yaml_files: | ||
with open(f, "r") as stream: | ||
try: | ||
data = yaml.safe_load(stream) | ||
except yaml.YAMLError as exc: | ||
print(exc) | ||
|
||
tmp_df = pd.json_normalize(data, max_level=2) | ||
df_list.append(tmp_df) | ||
|
||
df = pd.concat(df_list) | ||
|
||
# Data formatting: converts system-tested.description yaml value to rst | ||
# format for external links | ||
df.loc[ | ||
df["system_definition.system-tested.description"].notna(), | ||
"system_definition.system-tested.description", | ||
] = ( | ||
"`" | ||
+ df.loc[ | ||
df["system_definition.system-tested.description"].notna(), | ||
"system_definition.system-tested.description", | ||
].astype(str) | ||
+ "`_" | ||
) | ||
|
||
# Data formatting: converts top500-system-instances yaml list to rst string | ||
# of strings (ideally to put 1 per line) | ||
list_of_strings = [] | ||
for i in df["system_definition.top500-system-instances"]: | ||
list_of_strings.append(", ".join(item for item in i if item)) | ||
df.loc[:, "system_definition.top500-system-instances"] = list_of_strings | ||
|
||
# Remove system_definition from all field names | ||
# (e.g., system_definition.system-tested.description) | ||
df.columns = df.columns.str.removeprefix("system_definition.") | ||
|
||
# Replace NaN with empty string | ||
df.fillna("", inplace=True) | ||
|
||
# Set index to be field names | ||
df.set_index("name", inplace=True) | ||
|
||
# Write out current system definitions to CSV format | ||
df.to_csv("legacy-current-system-definitions.csv") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,4 @@ | |
:caption: Legacy Workflow | ||
|
||
legacy-getting-started | ||
legacy-system-list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. Copyright 2023 Lawrence Livermore National Security, LLC and other | ||
Benchpark Project Developers. See the top-level COPYRIGHT file for details. | ||
SPDX-License-Identifier: Apache-2.0 | ||
===================== | ||
System Specifications | ||
===================== | ||
|
||
The table below provides a directory of information for systems that have been | ||
specified in Benchpark. The column headers in the table below are available for | ||
use as the ``system`` parameter in ``benchpark setup``. | ||
|
||
.. csv-table:: Legacy System Specifications in Benchpark. | ||
:class: datatable | ||
:file: legacy-current-system-definitions.csv | ||
:header-rows: 1 | ||
:align: left |