Skip to content
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

Fixes #1230. Update mapl_tree.py #1231

Merged
merged 7 commits into from
Dec 14, 2021
Merged

Conversation

mathomp4
Copy link
Member

Description

An attempt to fix mapl_tree.py

Related Issue

Closes #1230

Motivation and Context

Makes a code that used to work in CVS days, work again.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@mathomp4 mathomp4 added the 0 Diff Trivial The changes in this pull request are trivially zero-diff (documentation, build failure, &c.) label Dec 13, 2021
@mathomp4 mathomp4 self-assigned this Dec 13, 2021
@mathomp4
Copy link
Member Author

mathomp4 commented Dec 13, 2021

I might need to discuss this with @tclune and others. I'm not sure the chname variant of this should exist. It's...very fragile.

ETA: and @bena-nasa

@tclune
Copy link
Collaborator

tclune commented Dec 13, 2021

We may need 2 different spellings for the various GC directories to be future-safe. One of the things we wanted to do with Git was to reconcile GC names and dir names. E.g., GEOS_AgcmGridComp should always have been in GEOS_AgcmGridComp directory, but due to a miscommunication, it is in GEOSagcm_GridComp directory

This is true of most gridcomps. I think we have either corrected it in one place or introduced a new component "correctly".

@mathomp4
Copy link
Member Author

mathomp4 commented Dec 14, 2021

Okay. What I have here seems to work in the dirname case. It is still quite broken for the chname case. As such, for now I've made it pretty much default to use dirname without options. At this point, the only required argument is --rootdir. It also defaults to ascii.

Now, I think there are still issues with --color and --link. It's hard to test since FreeMi nd is nigh-dead. The mindmap output does work in, say, XMind, but I don't think XMind cares about links and colors when it imports a FreeMind file.

Still, you do get something:
GEOSgcm

This was created with:

python3 ./src/Shared/@MAPL/base/mapl_tree.py --rootdir ~/Models/GEOSgcm-TreeFix/GEOSgcm --outform mindmap > ~/testmm.mm

Of course, your paths may vary.

Also, in the code by default I don't expand out some directories. Things like MOM, MOM6, GEOS-CHEM, etc. that are external and are often very deep. If you want these to expand, add the --full flag.

mathomp4 and others added 4 commits December 14, 2021 09:30
* Disabled chname "mode" as it is really not necessary and not very robust
* Introduced "trim" option to skip non GridComps, shorten components names, and add some built-in aliases for readbility
@mathomp4
Copy link
Member Author

I just did a sweep and cleaned up some comments. EditorConfig did a bit of whitespace cleaning as well. This does seem to work for now, so I think we are safe to pull into MAPL. Always better to have working code that might not be perfect than code we know doesn't work!

Thanks to @amdasilva for extra additions and cleanup

@mathomp4 mathomp4 marked this pull request as ready for review December 14, 2021 20:22
@mathomp4 mathomp4 requested review from a team as code owners December 14, 2021 20:22
@tclune tclune merged commit 83628ee into develop Dec 14, 2021
@amdasilva
Copy link
Contributor

amdasilva commented Dec 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff Trivial The changes in this pull request are trivially zero-diff (documentation, build failure, &c.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants