-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4,268 changed files
with
504,660 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Binary file not shown.
Empty file.
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,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Load JSON Key Display</title> | ||
<link rel='stylesheet' href='https://bootswatch.com/5/sketchy/bootstrap.css'> | ||
<style> | ||
body { padding:10px; } | ||
h2 { font-size:0.8rem; margin-left: 10px } | ||
h3 { font-size:0.6rem; margin-left: 15px ; color:gray } | ||
p { margin-left: 30px } | ||
pre {border: none; padding:40px} | ||
ul {padding-left: 40px} | ||
</style> | ||
</head> | ||
<body> | ||
<h1 id='title'>Data Descriptor</h1> | ||
<div> | ||
<code id="content"></code> | ||
</div> | ||
|
||
<script src='https://wcrp-cmip.github.io/CMIP-LD/static/404_restful.js'> | ||
|
||
</script> | ||
</body> | ||
</html> |
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,66 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import os, glob, json, sys, re\n", | ||
"from collections import OrderedDict" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"tables = glob.glob('tables/*.json')\n", | ||
"\n", | ||
"for i in tables:\n", | ||
" with open(i) as f:\n", | ||
" data = json.load(f)\n", | ||
" data['type'] = 'mip_table'\n", | ||
" data['product'] = {'id': f\"{data['product']}.json\"}\n", | ||
" \n", | ||
" # https://wcrp-cmip.github.io/WCRP-UNIVERSE/data_descriptors/product/\n", | ||
" \n", | ||
" data = OrderedDict(sorted(data.items()))\n", | ||
" \n", | ||
" json.dump(data, open(i, 'w'), indent=4)\n", | ||
" \n", | ||
"\n", | ||
" " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "base", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.10" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.