MethodSCRIPT
This page documents the MethodSCRIPT (MS) method.
pypalmsens.MethodScript
Create a method script sandbox object.
The MethodSCRIPT Sandbox allows you to write your own MethodSCRIPT and run them on your instrument.
The MethodSCRIPT language allows for programming a human-readable script directly into the potentiostat. The simple script language makes it easy to combine different measurements and other tasks.
For more information see: https://www.palmsens.com/methodscript/
Methods:
-
to_dict–Return the technique instance as a new key/value dictionary mapping.
-
from_dict–Structure technique instance from dict.
-
from_method_id–Create new instance of appropriate technique from method ID.
-
from_file–Load methodscript from file.
-
to_file–Save script to file.
-
from_url–Download script over http.
Attributes:
-
id(Literal['ms']) –Unique method identifier.
-
script(str) –Script to run.
-
custom_units(dict[Literal['as', 'at', 'au'], CustomUnits]) –Define custom quantities and units for 'as', 'at', 'au' variable types.
script
class-attribute
instance-attribute
script: str = 'wait 100m\nif 1 < 2\n send_string "Hello world"\nendif\n'
Script to run.
For more info on MethodSCRIPT, see: https://www.palmsens.com/methodscript/ for more information.
custom_units
class-attribute
instance-attribute
Define custom quantities and units for 'as', 'at', 'au' variable types.
Use this to override the quantities for analog inputs (0, 1, and 2). These default to Voltage / V. Defining custum units is purely cosmetic. The values are used for labeling curves and axes.
to_dict
Return the technique instance as a new key/value dictionary mapping.
Source code in src/pypalmsens/_methods/base.py
45 46 47 | |
from_dict
classmethod
from_dict(obj: dict[str, Any]) -> MethodType
Structure technique instance from dict.
Opposite of .to_dict()
Source code in src/pypalmsens/_methods/base.py
49 50 51 52 53 54 | |
from_method_id
classmethod
from_method_id(id: str) -> MethodType
Create new instance of appropriate technique from method ID.
Source code in src/pypalmsens/_methods/base.py
56 57 58 59 60 | |
from_file
classmethod
from_file(path: str | Path = 'methodscript.mscr') -> MethodScript
Load methodscript from file.
Parameters:
Returns:
-
method(MethodScript) –
Source code in src/pypalmsens/_methods/techniques.py
2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 | |
to_file
Save script to file.
Parameters:
Source code in src/pypalmsens/_methods/techniques.py
2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 | |
from_url
classmethod
from_url(url: str) -> MethodScript
Download script over http.
Parameters:
-
(urlurl) –URL to download methodscript file from.
Returns:
-
method(MethodScript) –
Source code in src/pypalmsens/_methods/techniques.py
2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 | |