Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • bliss bliss
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 605
    • Issues 605
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 165
    • Merge requests 165
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • BlissBliss
  • blissbliss
  • Issues
  • #847

Sessions, shell functions and globals refactoring

Following the meeting we had yesterday, in order to clarify and solve discussions about sessions, shell (user) functions and globals refactoring, here are conclusions and corresponding tasks:

Guidelines

  • we need to ensure BLISS stays 100% usable as a library
    • basic rules to be followed: everything should be explicit, no calls to print
    • differentiate shell functions and library functions
  • a Session corresponds to an experimental setup
    • groups devices and a setup file
  • global variables usage should be limited
    • in general we can always find an object to attach those to
  • running multiple sessions is allowed (although probably not so useful)
    • too difficult to do checks to forbid it
  • the current session is the last one initialized (.setup() called)

Todo

  • create bliss.shell.standard to put user/shell functions
    • should include messages for user (see next task)
    • can show dialogs
    • there should be a corresponding function in bliss.common.standard to do the 'real' job
  • replace print with calls to a new 'user print' function: lprint
    • should rely on the logging facility
    • a special formatter in BLISS shell will display all those messages
      • no date, no time, no log level: just the message (like print)
  • add a logbook object in BLISS
    • should have a .log_message() method to send messages to be displayed
    • should be available from Flint, too
      • for example, it could be extended with .log_scan() to put scan data in the form of a table or a .png plot
  • the BLISS map has to be made global, process-wise
    • not attached to a session
  • no automatic default session anymore
    • session.get_current() will return None if no session has been setuo
    • Q: how to create a new, empty session in library mode ?
      • still possible to keep DefaultSession so from bliss.common.session import DefaultSession; new_session=DefaultSession() would work ?
  • scans won't work if no session is currently defined
    • Scan object should take a session argument, to get access to scan saving
  • add .scan_saving property in Session object
    • will be used for SCAN_SAVING in shell, from current session
    • will be used by scans
  • no SCAN_DISPLAY handling in Scan object
    • should be implemented differently, only from shell
      • monkey patching the class ?
      • subclassing Scan in shell ?
      • reserving a callback that does nothing by default ?
  • add .active_measurement_group property in Session object
    • will be used for ACTIVE_MG in shell, from current session
  • add .user_scan_meta property to Session object
    • will be used for USER_SCAN_META in shell, from current session
  • add .scans to Session object
    • will be used for SCANS global in shell only, from current session
  • Aliases to be attached to the global map
    • error to be raised in case of duplicated aliases from 2 different sessions
  • the default, empty session (when BLISS shell is started without specifying a session) to be called __DEFAULT__
    • tmux will open a new terminal, but [F5] will still display scans from all default sessions => ok
Edited Dec 04, 2019 by Matias Guijarro
Assignee
Assign to
Time tracking