Code Monkey home page Code Monkey logo

pyesapi's Introduction

PyESAPI

"Pie-Sappy" for research use only.

A passion project to help accelerate breakthroughs in medical physics research by bringing the power of Python into the Varian API ecosystem.

Quickstart (updated June 16th 2023)

  • Access your Eclipse 15.5 (or later) TBOX desktop
  • Install Python 3.10 or higher from: https://www.python.org/downloads/
  • Optionally install google chrome or chromium browser (for better Jupyter Notebook experience) and set it as your default browser
  • Launch "Command Prompt" by searching in Windows menu
  • Navigate to a directory where you would like to store your first PyEsapi project using the cd command
  • (optional) Create and activate a python virtual environment in this location using python -m venv venv
  • In the prompt, execute the commands:
    • pip install https://api.github.com/repos/VarianAPIs/PyESAPI/tarball
    • pip install jupyter
  • Then execute the command jupyter notebook
  • Create a new notebook and see below for examples (be sure not to select "root" kernel).

Examples

Upgrading

  • Inside your project directory, execute pip install https://api.github.com/repos/VarianAPIs/PyESAPI/tarball --upgrade
    • This will check and upgrade PyESAPI if a newer version is available

Development

For those wishing to contribute to PyESAPI

Custom ESAPI DLL path

Set custom ESAPI_PATH (to DLLs) before import (bypasses production directory path search)

import os
os.environ['ESAPI_PATH'] = r'C:\Users\CoolKid\Source\Magic\Bin\Debug64'
import pyesapi
# ...

Stub Gen

To create lintable code and enable code completion (in Visual Studio Code at least) we generate python stubs for ESAPI libs...

  1. Download and install IronPython (2.7.9 tested to work) in default location (C:\Program Files\IronPython 2.7\ipy.exe).
  2. Load ironpython-stubs submodule git submodule update --init (ironstubs)
  3. Move to stubgen folder cd stubgen
  4. Execute script stubgen.ps1 (if you hit a Pdb prompt, type continue)
  5. Commit updates to stubs folder

TODOs

pyesapi's People

Contributors

fizxmike avatar brianmanderson avatar clmw83 avatar craman96 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.