Recent Changes · Search:

Dispense


Navigation Tips - Dritte


PmWiki

pmwiki.org

edit SideBar

Mudashed

< Mujpy.Changelog | Index | Mujpy.Methods2 >


Barebone edit dash

Provides a simple way to build the dashboard.json file for a fit. How to use it?

  • Run from mudashed.ipynb
  • mudashed builds itself in three stages and is based on four boxes:
    • suite_box (three HBox: info, groups, runlist)
    • command_box (two HBox: pre-model choices, fit plot buttons)
    • global parameters, VBox of rows (HBox)
    • model_box is a more complex cascade: HBox of two VBox (columns) of VBox (components) of HBox (component widgets, pardicts widgets)
  • First stage, grp_calib dict, data path to prototype run, runlist, the latter triggers the following
  • Second stage, only first row of command box, sequential/global Toggle, global parameter number (NG) [0], model acronym Text (MN), version Label (VL) [default 1], load Button (LL) last mudashed standard dashboard.json into self.dashboard, load Button (LF) from fit file into self.dashboard
  • Third stage builds the rest:
    • second row of command box, generated upon valid MN (or LL or LF) : Fit Button, with fit range (FR), Plot Botton, with fit/guess and plot range (PR), rotation frame frequency [0] (RF), FFT Button with nu range (NR), line broadening (LB), frequency broadening (FB), actually done by self.command2dash
    • some of these widgets require on_click or observe: all the Buttons, the Toggle, MN and LB
    • on_MN calls class methods self.command2dash() and self.json2dash(), all on_click and observe methods can be class private methods.
    • self.json2dash() builds the model [and global] widgets box both for LL LF, that load a json file, and from MN that knows only NG and the model acronym.
    • Notice, now also the functions and limits could be observed, to validate each single dashed input. Not implemented yet, so model and global box input do not require observe synchronous action, for the moment.
    • HBox background color
    • NG_int.value (number of global parameters) and MN_text.value (model acronym) can be passed directly as argument to each of them, respectively
  • self.dashboard is created to dump_dashed() a dashed.json, file passed as dashboard_file to mufit; could also be passed directly but its good to have a saved version of the model
    • class methods def dash2json(self): and def json2dash(self):, so that each has read/write access to the self boxes and dashboard methods
    • dash2json reads widgets into self.dashboard['model_guess'] (and ['globpardicts_guess'] if NG_int.value>0) and json2dash does the opposite
  • Further smaller temporary advantages of a class
    • class is also easier to debug, since instance exposes its methods to jupyter (more complex mudash might need this again)

Summarizing, the following must be accessible class methods

  • self.__version__, self.suite and self.log [?],
  • def __init__(self, suite): and def board(self):
  • self.command_box, self.global_box, self.model_box
  • def dash2json(self): and def json2dash(self):

This does forbid use of tools methods to standardize common parts of the widget construction



< Mujpy.Changelog | Index | Mujpy.Methods2 >

Edit - History - Print - PDF - Recent Changes - Search
Page last modified on August 18, 2026, at 02:27 PM