Code Monkey home page Code Monkey logo

elog's Introduction

ELog

Python API to the Photon Experimental ELog

InstallationBasic UsageAuthenticationTest Suite

Installation

The elog package is available on both the pcds-tag and pcds-dev conda channels. Quick installation looks like:

conda install elog -c pcds-tag

Basic Usage

The most common use case for the ELog is to interface with the current experiment logbook and facilities logbook for a given endstation. If this is your use case, the HutchELog handles finding both of these automatically. Otherwise, you can manually enter the Logbook id in the base ELog class.

   import elog
   mfx_elog = elog.HutchELog('MFX')

Use the post method to add messages to the pswwww site with any additional tags and attachments you may need. By default, the experiment logbook is posted to, but the facility logbook is not, simply adjust this by using the facility and experiment keywords:

   # Post a message to the experiment logbook
   mfx_elog.post('This is experiment information', tags=['sample'])
   # Post a message to both logbooks
   mfx_elog.post('Important: Everyone please read', facility=True)
   # Post a message to only the facility logbook
   mfx_elog.post('Note for controls staff', experiment=False,
                 tags=['bug_report'],
                 attachments=[('path/to/log.txt', 'Relevant log file')])

Authentication

Most users will authenticate with kerberos, this is the assumption made if no username or password is passed into the class constructor. However, for certain accounts password authentication is needed. Four examples of different authentication methods are shown below:

   # Kerberos ticket is used for authentication
   elog.ELog()
   # Log-in as user but request the password via command line
   elog.ELog(user='user')
   # Log-in as user directly
   elog.ELog(user='user', pw='not_my_pw')
   # Search for a configuration file that contains username and password
   elog.ELog.from_conf()

Test Suite

The automated testing package has multiple options to attempt to interface with the actual web service. If you want to run these tests you can either authenticate with --user and/or you can use the keyword kerberos.

python run_tests.py --user my_user --pw my_pw --kerberos

There are also tests that post to the web service but these are disabled by default. If you think you need to run these in order to check changes you have made to the repository use --post.

elog's People

Contributors

klauer avatar slacmshankar avatar zllentz avatar zrylettc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.