Skip to content

Consolidate base directory for diagnostics (obs, mapping and mask files) into one config option #500

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

Merged
merged 5 commits into from
Jan 10, 2019

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Dec 2, 2018

This merge consolidates the base directory for diagnostics in each config file into one baseDirectory option in the new [diagnostics] section. This means there is only one option that needs to be changed in order to point to the diagnostics directory on each machine instead of needing to set this directory in 4 or 5 different places.

The new [diagnostics] section includes the baseDirectory as well as the mapping and region-masks subdirectories, using the standard directory layout as on the E3SM diagnostics server.

The various *Observations sections (for ocean, sea ice and icebergs) have also been modified to reference this new standard base directory so users will need to change very little to set up a new config file.

Many tasks and quite a bit of documentation needed to be updated to handle these seemingly minor changes.

Example config file have also been updated with new diagnostics section. Various other sections and options were removed as a result of the simplification.

A bug was fixed (for my convenience in debugging the code) in the PlotClimatologyMpasSubtask where decode() was being called on depthSlice even though this is already a string (not an array of bytes) in python 3. This bug shouldn't affect analysis performed with python 2.

@xylar xylar requested a review from milenaveneziani December 2, 2018 06:48
@xylar
Copy link
Collaborator Author

xylar commented Dec 2, 2018

@milenaveneziani, this came up when I was trying to explain config files to Karthik on his visit last week. It became clear to me that things are unnecessarily complicated now that we have a standard directory structure and should be simplified.

Let me know if you have concerns. It would be great if you could run a test or two but I know you're preparing for AGU just like I am...

@xylar xylar self-assigned this Dec 2, 2018
@xylar xylar changed the title Base directory for diagnostics (obs, mapping and mask files) in one config option Consolidate base directory for diagnostics (obs, mapping and mask files) into one config option Dec 2, 2018
@milenaveneziani
Copy link
Collaborator

@xylar, I just took a quick look. I wonder if it is a good idea to not allow the user to specify the various directories manually, if they want to.
Pinging @vanroekel as well to see if he has an opinion on this.

[regions]
# Directory containing mask files for ocean basins and ice shelves
regionMaskDirectory = /lus/theta-fs0/projects/ClimateEnergy_2/diagnostics/mpas_analysis/region_masks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the section below removed from this config file (same goes for other sections in other config files)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the whole point of this PR. People shouldn't need to point to these directories manually now that the directory structure is standardized.

Are you thinking that people would need to make their own region masks and point to those directories? I guess that's conceivable, particularly for non-standard grids.

My thought was that we want the example config files to be relatively simple. I guess you prefer to keep them relatively verbose and to point out to users that they could point the mappingSubdirectory and/or regionMaskSubdirectory as an absolute path?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, in this case I only meant the section below that has other (unrelated) things in it.
I would only keep config.example more verbose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. The way comments work on GitHub, all I see are the previous 3 lines to your comment so that wasn't clear. It could be that i need to put the MOC section back in but I don't think the rest of this is helpful. It just makes it a lot harder to change default options because all of the example config files have to be changed to match. I think the examples should be relatively lean.

Copy link
Collaborator

@milenaveneziani milenaveneziani Dec 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, agree that only the MOC section should be put back in for this specific config files, while the others are redundant/arbitrary.

@xylar
Copy link
Collaborator Author

xylar commented Dec 4, 2018

@xylar, I just took a quick look. I wonder if it is a good idea to not allow the user to specify the various directories manually, if they want to.

You can still specify the paths to any of the directories as absolute paths, so someone could specify them manually. However, I think we want to discourage folks from having their own directory structure going forward so I don't know that this capability needs to be well advertised.

@milenaveneziani
Copy link
Collaborator

Well, why not? If the user needs to play with the directory structure for one reason or another, we should let them know they can.
We could just do it in the config.example file (commenting out the specific directory names and mentioning the option).

[regions]
# Directory containing mask files for ocean basins and ice shelves
regionMaskDirectory = /lus/theta-fs0/projects/ClimateEnergy_2/diagnostics/mpas_analysis/region_masks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is another example of section (below this comment) that seems unrelated to this PR and that is being removed. Not sure if it was intentional or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really think we don't want this stuff in the example config files, so, yes, it was intentional.


# directory where sea ice observations are stored
baseDirectory = /lcrc/group/acme/diagnostics/observations/SeaIce

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this piece below about timeSeriesSeaIceAreaVol. And similarly for other config example files.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it seems this may be the last config file with this issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all default options being copied into example config files. I realize they might demonstrate to users some of the capabilities that they could customize but we have several hundred such options at this point and these few are just arbitrary in my view. As I said, they make changing defaults very difficult and I think they confuse and overwhelm new users rather than providing helpful direction. That's why I think we want to keep the examples as more the minimum set of options needed to analyze that particular example run and rely on documentation, config.example and config.default to point out additional options.

@xylar
Copy link
Collaborator Author

xylar commented Dec 4, 2018

Well, why not? If the user needs to play with the directory structure for one reason or another, we should let them know they can.
We could just do it in the config.example file (commenting out the specific directory names and mentioning the option).

Okay, I think that sounds like a good plan.

# in its calculation, whereas the postprocessing script does.
# NOTE: this is a temporary option that will be removed once the online
# MOC takes into account the bolus velocity when GM is on.
usePostprocessingScript = True
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will put the MOC section back. That was removed by mistake.

@xylar xylar force-pushed the clean_up_diagnostic_dir branch from e981415 to 90deded Compare December 4, 2018 06:26
@xylar
Copy link
Collaborator Author

xylar commented Dec 4, 2018

@milenaveneziani, thanks very much for all the helpful comments. Sorry if I'm grumpy about them sometimes. And I know I also have strong opinions sometime. But you can always feel free to have strong opinions, too. You are nearly always right when you push me to do things a different way, so I appreciate that.

@xylar
Copy link
Collaborator Author

xylar commented Dec 4, 2018

I believe I've addressed the concerns you raised but please let me know if you notice anything more that I missed. I will re-test on my side but I would also appreciate it if you could do a test or 2 yourself, perhaps giving an absolute path to the regions, mapping or observations subdirectories and make sure it does, in fact, work for you.

@milenaveneziani
Copy link
Collaborator

No problem. Remember, I am a 'stuff keeper' :D

Ok, I will run a test hopefully tomorrow.

@xylar
Copy link
Collaborator Author

xylar commented Dec 4, 2018

Ah, right! I should cc Gennaro on these messages. He would understand ;-)

@xylar
Copy link
Collaborator Author

xylar commented Dec 17, 2018

@milenaveneziani, have you had a chance to test this one? Are you happy with it now?

xylar added 4 commits January 10, 2019 17:16
This includes a baseDirectory and the mapping and region-masks
subdirectories, using the standard directory layout as on the
E3SM diagnostics server.

The various *Observations sections have also been modified to
reference this new standard base directory so users will need to
change very little to set up a new config file.

Many tasks and quite a bit of documentation needed to be updated
to handle these seemlingly minor changes.

Example config files will be updated in a separate commit.
Various other sections and options were removed as a result of the
simplification.
* Clarify in both that various subdirectories could also be
  absolute paths
* Put these subdirectories in config.example so users can see
  that they are there to be modified if needed.
@xylar xylar force-pushed the clean_up_diagnostic_dir branch from 90deded to 06d559e Compare January 10, 2019 16:16
@xylar
Copy link
Collaborator Author

xylar commented Jan 10, 2019

@milenaveneziani, I believe this PR is just waiting on testing from you. Is that correct?

@milenaveneziani
Copy link
Collaborator

oh cute, there is an actual stickler-ci reviewer! funny.
yes, thanks for the reminder @xylar, I'll test this shortly.

Copy link
Collaborator

@milenaveneziani milenaveneziani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test passed.

@xylar
Copy link
Collaborator Author

xylar commented Jan 10, 2019

Excellent! Thank you for testing, @milenaveneziani.

@xylar xylar merged commit e178d27 into MPAS-Dev:develop Jan 10, 2019
@xylar xylar deleted the clean_up_diagnostic_dir branch January 10, 2019 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants