diff --git a/scripts/upload_data_files_to_figshare.py b/scripts/upload_data_files_to_figshare.py index dbd39c25..c3c13d85 100644 --- a/scripts/upload_data_files_to_figshare.py +++ b/scripts/upload_data_files_to_figshare.py @@ -33,8 +33,10 @@ def main( article will be created. pyproject (dict[str, Any]): Dictionary containing the project metadata. max_file_size (int): Maximum file size in bytes to be uploaded automatically. - files (list[DataFiles] | None): List of DataFiles to upload. + files (list[DataFiles] | None): Which attributes of DataFiles to upload. + Defaults to all. """ + article_is_new = False if article_id is not None: # Check if article exists and is accessible if figshare.article_exists(article_id): @@ -71,10 +73,12 @@ def main( if article_id is None: article_id = figshare.create_article(metadata) + article_is_new = True print( f"\n⚠️ Created new Figshare article with {article_id=}" f"\nUpdate FIGSHARE_ARTICLE_ID in {__file__} with this ID!" ) + article_url = f"{figshare.ARTICLE_URL_PREFIX}/{article_id}" try: # Load existing YAML data if available @@ -158,6 +162,18 @@ def main( print("\nUpdated files:") for idx, (data_file, url) in enumerate(updated_files.items(), start=1): print(f"{idx}. {data_file}: {url}") + + # Publish the article if any new files were added and it's not newly created + if article_is_new: + print( + "\n⚠️ Article was newly created. Please review it at " + f"{article_url} before publishing manually." + ) + else: + print( + f"\nFiles were added or updated. Publishing article {article_url}" + ) + figshare.publish_article(article_id) else: print("\nNo files were added or updated.") diff --git a/scripts/upload_model_preds_to_figshare.py b/scripts/upload_model_preds_to_figshare.py index 6e50d9dc..080e7089 100644 --- a/scripts/upload_model_preds_to_figshare.py +++ b/scripts/upload_model_preds_to_figshare.py @@ -150,6 +150,7 @@ def update_one_modeling_task_article( ) -> None: """Update or create a Figshare article for a modeling task.""" article_id = figshare.ARTICLE_IDS[f"model_preds_{task}"] + article_is_new = False if article_id is not None: # Check if article exists and is accessible @@ -166,6 +167,7 @@ def update_one_modeling_task_article( else: metadata = get_article_metadata(task) article_id = figshare.create_article(metadata) + article_is_new = True print( f"\n⚠️ Created new Figshare article for {task=} with {article_id=}" f"\nUpdate figshare.ARTICLE_IDS with this ID!" @@ -335,10 +337,16 @@ def find_file_keys(data: dict[str, Any], prefix: str = "") -> dict[str, str]: ): print(f"{idx}. {model.name} {filename}: {url}") - # Publish the article if any new files were added and it's not a dry run - if (new_files or updated_files) and not dry_run: - print("\nNew or updated files were added. Publishing the article...") + # Publish the article if any new files were added, it's not a dry run, + # and the article wasn't newly created + if (new_files or updated_files) and not dry_run and not article_is_new: + print(f"\nFiles were added or updated. Publishing article {article_url}") figshare.publish_article(article_id) + elif article_is_new: + print( + "\n⚠️ Article was newly created. Please review it at " + f"{article_url} before publishing manually." + ) else: print("\nNo files were added or updated.") diff --git a/site/package.json b/site/package.json index 1e24b5ab..63eb5c5c 100644 --- a/site/package.json +++ b/site/package.json @@ -19,24 +19,24 @@ }, "devDependencies": { "@rollup/plugin-yaml": "^4.1.2", - "@stylistic/eslint-plugin": "^3.1.0", + "@stylistic/eslint-plugin": "^4.2.0", "@sveltejs/adapter-static": "^3.0.8", - "@sveltejs/kit": "^2.17.2", - "@sveltejs/vite-plugin-svelte": "^4.0.3", + "@sveltejs/kit": "^2.20.2", + "@sveltejs/vite-plugin-svelte": "^5.0.3", "d3-array": "^3.2.4", "d3-scale": "^4.0.2", "d3-scale-chromatic": "^3.1.0", - "elementari": "^0.2.7", - "eslint": "^9.20.1", - "eslint-plugin-svelte": "^2.46.1", - "hastscript": "^9.0.0", + "elementari": "^0.3.0", + "eslint": "^9.23.0", + "eslint-plugin-svelte": "^3.3.3", + "hastscript": "^9.0.1", "iconify-icon": "^2.3.0", "js-yaml": "^4.1.0", "jsdom": "^26.0.0", "json-schema-to-typescript": "^15.0.4", "katex": "^0.16.21", "mdsvex": "^0.12.3", - "prettier": "^3.5.1", + "prettier": "^3.5.3", "prettier-plugin-svelte": "^3.3.3", "rehype-autolink-headings": "^7.1.0", "rehype-katex-svelte": "^1.2.0", @@ -45,19 +45,19 @@ "remark-math": "6.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.1.1", - "svelte": "^5.20.1", - "svelte-check": "^4.1.4", + "svelte": "^5.25.3", + "svelte-check": "^4.1.5", "svelte-multiselect": "11.0.0-rc.1", "svelte-preprocess": "^6.0.3", "svelte-toc": "^0.5.9", "svelte-zoo": "^0.4.17", - "svelte2tsx": "^0.7.34", + "svelte2tsx": "^0.7.35", "tslib": "^2.8.1", - "typescript": "5.7.3", - "typescript-eslint": "^8.24.1", + "typescript": "5.8.2", + "typescript-eslint": "^8.28.0", "unified": "^11.0.5", - "vite": "^5.4.11", - "vitest": "^3.0.5" + "vite": "^6.2.3", + "vitest": "^3.0.9" }, "prettier": { "semi": false, diff --git a/site/src/figs/bar-element-counts-mp+wbm-normalized=False.svelte b/site/src/figs/bar-element-counts-mp+wbm-normalized=False.svelte index 917dcc41..4d889017 100644 --- a/site/src/figs/bar-element-counts-mp+wbm-normalized=False.svelte +++ b/site/src/figs/bar-element-counts-mp+wbm-normalized=False.svelte @@ -1 +1 @@ -
+
+ {#if show_details}
If page reloading doesn't help, please raise an issue on
GitHub. Thanks! 🙏
diff --git a/site/src/routes/+layout.svelte b/site/src/routes/+layout.svelte
index efd71486..a5f40f34 100644
--- a/site/src/routes/+layout.svelte
+++ b/site/src/routes/+layout.svelte
@@ -1,25 +1,24 @@
diff --git a/site/src/routes/data/+page.svelte b/site/src/routes/data/+page.svelte
index 849d53c0..dc401a22 100644
--- a/site/src/routes/data/+page.svelte
+++ b/site/src/routes/data/+page.svelte
@@ -17,10 +17,7 @@
const elem_counts = import.meta.glob(
`./*-element-counts-by-{occurrence,composition}*.json`,
- {
- eager: true,
- import: `default`,
- },
+ { eager: true, import: `default` },
)
let log = $state(false) // log color scale
@@ -109,8 +106,10 @@
{#snippet spacegroup_sunbursts()}
{#if browser}
-
@@ -25,7 +28,7 @@