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

Updates for xija_gui_fit #116

Merged
merged 19 commits into from
Feb 14, 2022
Merged

Updates for xija_gui_fit #116

merged 19 commits into from
Feb 14, 2022

Conversation

jzuhone
Copy link
Collaborator

@jzuhone jzuhone commented Feb 3, 2022

Description

This PR fixes a number of annoying bugs in xija_gui_fit and refactors the design of a few features.

  • The console access has been removed. It was an experimental feature that never worked very well anyway, and getting it to work to design scripting of the interface was proving intractable.
  • Improved the handling of "bad times" which one wants to store in the JSON file and the "mask times", which includes the bad times but also includes times that are masked out temporarily in the GUI for fitting.
  • Added a splitter between the plots window and the parameter panel so you can adjust the horizontal size of the two parts
  • Fixed some issues with the scaling of the x-axis of plots, especially when adding/deleting. This was partially achieved by adding a dummy Figure, Axes pair that is never displayed but also never goes away and is used as the shared axes.
  • The command entry box, used for freezing and thawing parameters as well as adding times to mask and removing the mask times, has been removed, and the functionalities have been separated out. Now, freeze and thaw entry boxes appear above the parameters panel. A new button for "filters" appears on the left panel (see image below), which handles adding mask times. To freeze or thaw a parameter, enter the regular expression into either box (e.g., solarheat*__P*) and hit Enter.
  • General reorganization of the buttons on the left panel.
  • The ability to add a "bad time" to the model JSON file from the GUI has been added and is part of the "filters" panel.

The new look of the window:

Screen Shot 2022-02-03 at 8 51 02 AM

The new "Filters" subwindow, showing how to add a mask and ignore all masks, and how to add a "bad time":

Screen Shot 2022-02-03 at 8 52 05 AM

Testing

  • Passes unit tests on MacOS, linux, Windows (at least one required)
  • Functional testing

@jzuhone
Copy link
Collaborator Author

jzuhone commented Feb 3, 2022

@taldcroft
Copy link
Member

@jzuhone - awesome work glad to see this tool getting continued attention.

I think this will fall in the category of a package update that tags along in a normal Ska FSDS request. It wasn't obvious in 5 seconds what is going on with the diff you highlighted above, but from FSDS perspective the key is to highlight interface impacts at the top level (in the PR description) and make sure in advance that likely users are aware. That pretty much means ACIS ops, @matthewdahmer and occasionally me.

When we make the Ska update request then this can be highlighted if necessary as a notable change.

@jzuhone
Copy link
Collaborator Author

jzuhone commented Feb 3, 2022

@taldcroft the change in the diff I linked should be a no-op, it's just that it's the only part that could conceivably affect model evaluation if I screwed something up.

@taldcroft
Copy link
Member

@jzuhone - I gave this a spin in ska3-next and it works, but I do see a bunch of new warnings:

The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.

@javierggt will probably have a new 2022.2rc4 release out shortly that includes sot/ska_matplotlib#24, which changes the default plot_cxctime color (discussed previously on slack). Since this PR won't go in until after 2022.2 (sot/skare3#774) you might as well start testing there.

@taldcroft
Copy link
Member

One feature request (and maybe it's already there?) is to be able to get any flight model with the name, e.g.

xija_gui_fit aca --stop=2022:001 --days=200 --set-data='aca0=-10'

This would grab the latest flight model from chandra_models with xija_get_model_spec for any model_name that doesn't end in .json. Or something like that.

@jzuhone
Copy link
Collaborator Author

jzuhone commented Feb 4, 2022

@taldcroft

when are you getting this warning?

The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.

I don't see it.

@taldcroft
Copy link
Member

Huh, I tried again and I don't see that now. Well, never mind for the moment.

@matthewdahmer
Copy link
Contributor

@taldcroft @jzuhone I saw that same error, "__THE_PROCESS_HAS_FORKED...", once on my Apple Silicon Mac. During that instance, once I saw it I was not able to get xija_gui_fit to run until I rebooted, then it worked fine.

@jzuhone
Copy link
Collaborator Author

jzuhone commented Feb 7, 2022

Weird. Anyway, I added the new feature @taldcroft requested. It also prompts if you have an unsaved model when you hit the Quit button.

@taldcroft
Copy link
Member

I added the new feature @taldcroft requested. It also prompts if you have an unsaved model when you hit the Quit button.
Nice! I also like the new Thaw/Freeze boxes, when I was using the previous version I had to think for a few seconds to remember the right words.

One more feature request - put the xija version into the App title? In testing just now I had been accidentally getting the wrong version so it would be nice to see the version.

Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

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

I did some more light testing of this in ska3-next (rc4) and didn't see any problems, so good from my perspective. Note that I did not look at the code changes.

@@ -1082,7 +1082,8 @@ def set_title(self):
title_str = "no filename"
if not self.checksum_match:
title_str += "*"
self.window.setWindowTitle(f"xija_gui_fit ({title_str})")
self.window.setWindowTitle(
f"xija_gui_fit v{xija.__version__} ({title_str})")
Copy link
Member

Choose a reason for hiding this comment

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

👍

@jzuhone
Copy link
Collaborator Author

jzuhone commented Feb 10, 2022

Ok to merge this before things get too busy?

@taldcroft
Copy link
Member

Fine by me to merge, but @matthewdahmer - are you good with this?

@matthewdahmer
Copy link
Contributor

@jzuhone @taldcroft I am OK with this update. I tested it on my Mac with a PLINE refit and seems to work well!

@taldcroft
Copy link
Member

BTW @jzuhone have you tested this with ska3-next on supported platforms?

I guess that isn't a lien on merging this since we can always come back with fixes as needed. My light testing was OK on that but it's worth noting that @javierggt experienced troubles with aca_view (another Qt app) and required export QT_MAC_WANTS_LAYER=1 to get it to work. (It is slightly perplexing that xija_gui_fit works without that).

@jzuhone
Copy link
Collaborator Author

jzuhone commented Feb 11, 2022

@taldcroft I have not yet tested against ska3-next--is there a documented way yet to set up a ska3-next environment?

@taldcroft
Copy link
Member

@jzuhone - the conda command under Testing in sot/skare3#774 should work.

@jzuhone
Copy link
Collaborator Author

jzuhone commented Feb 14, 2022

@taldcroft I tested under ska3-next and all appears to work fine.

@taldcroft
Copy link
Member

👍

@jzuhone
Copy link
Collaborator Author

jzuhone commented Feb 14, 2022

@taldcroft what's your position on who should merge this?

@taldcroft taldcroft merged commit d07f9cd into sot:master Feb 14, 2022
@javierggt javierggt mentioned this pull request Mar 30, 2022
@javierggt javierggt mentioned this pull request Aug 3, 2022
@jzuhone jzuhone deleted the fix_gui_fit branch September 7, 2022 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants