-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create webpage for simulation #25
Draft
forsyth2
wants to merge
1
commit into
E3SM-Project:main
Choose a base branch
from
forsyth2:auto-document
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
from validate import Validator | ||
import errno | ||
import os | ||
import re | ||
|
||
from climo import climo | ||
from ts import ts | ||
|
@@ -79,3 +80,33 @@ | |
# mpas_analysis tasks | ||
mpas_analysis(config, scriptDir) | ||
|
||
# Create page for the simulation | ||
analysis_dir = os.path.join(config['default']['www'], config['default']['case']) | ||
analysis_html = os.path.join(config['default']['html_path'], config['default']['case']) | ||
if config['e3sm_diags']['active'] and config['e3sm_diags']['atm_monthly_180x360_aave']: | ||
viewer_dir = dict() | ||
time_periods_dir = os.path.join('e3sm_diags', config['e3sm_diags']['atm_monthly_180x360_aave']['grid']) | ||
time_periods = os.listdir(os.path.join(analysis_dir, time_periods_dir)) | ||
# model_vs_obs_0001-0020 | ||
for time_period in time_periods: | ||
m = re.search('model_vs_obs_(\d\d\d\d)-(\d\d\d\d)', time_period) | ||
start_yr = int(m.group(1)) | ||
end_yr = int(m.group(2)) | ||
num_years = end_yr - start_yr + 1 | ||
viewer = "{}/viewer".format(os.path.join(analysis_html, time_periods_dir, time_period)) | ||
if num_years in viewer_dir.keys(): | ||
viewer_dir[num_years].append(viewer) | ||
else: | ||
viewer_dir[num_years] = [viewer] | ||
for num_years in viewer_dir.keys(): | ||
viewers = sorted(viewer_dir[num_years]) | ||
for viewer in viewers: | ||
print(viewer) | ||
forsyth2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if config['mpas_analysis']['active']: | ||
mpas_dir = os.path.join(analysis_dir, 'mpas_analysis') | ||
pages = os.listdir(mpas_dir) | ||
pages = ["{}".format(os.path.join(analysis_html, 'mpas_analysis', page)) for page in pages] | ||
for page in pages: | ||
print(page) | ||
|
||
# TODO: create a nice webpage (using Pandoc?) rather than just printing links | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could use pandoc (https://pandoc.org/index.html) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be useful to add variables for
generate_global_time_series_plots.sh
to the configuration file, so it can be run automatically frompost.py
. Then we can also find the global time series link to display.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #26 for the global time series plot generation