Skip to content

Commit

Permalink
Merge pull request #67 from epics-extensions/editorconfig
Browse files Browse the repository at this point in the history
Editorconfig
  • Loading branch information
minijackson authored Dec 8, 2023
2 parents 464f3a2 + d2c12e6 commit c34575c
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 48 deletions.
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[*.nix]
indent_style = space
indent_size = 2

[*.{toml,yml,yaml}]
indent_style = space
indent_size = 2

[*.md]
indent_style = space

[*.py]
indent_style = space
indent_size = 4

[*.sh]
indent_style = tab
indent_size = 4

[*.{db,dbd}]
indent_style = tab
indent_size = 4
18 changes: 18 additions & 0 deletions .github/workflows/editorconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Check EditorConfig"

permissions: read-all

on:
push:
pull_request:

jobs:
editorconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- name: "Check EditorConfig"
# Python already has Ruff,
# and doesn't necessarily have a consistent 4 spaces indent
run: nix run 'nixpkgs#eclint' --inputs-from . -- -show_all_errors -exclude "**/*.py"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Software: WeTest
c. Modified copies and works based on the Software must carry prominent notices stating that you changed specified portions of the Software.
5. Portions of the Software resulted from work developed under a French Government contract and are subject to the following license: the Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable worldwide license in this computer software to reproduce, prepare derivative works, and perform publicly and display publicly.
6. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDERS, THEIR THIRD PARTY LICENSORS, THE FRENCH, THE FRENCH DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED.
7. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDERS, THEIR THIRD PARTY LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES.
7. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDERS, THEIR THIRD PARTY LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES.
4 changes: 2 additions & 2 deletions wetest/generic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ See ```specific/weTest_functional_CAENels_PS_FAST_1K5_current.yaml``` to get an

As you can see in the above script, it is sometimes necessary to call several times the ```config``` (or an other part) to fit the power supply behavior. Here you have to first power on the channel and then set the setpoint (current command).

## Specific models
## Specific models

Files in ```specific``` folder can be seen as example but you can also use them if it is the power suplly you want to control.

Expand All @@ -40,4 +40,4 @@ Don't hesitate to:
- ask for new features (ex: polarity and regulation mode (current or voltage) were the last features added)
- add more specific models scripts

Contact: Victor Nadot, [email protected]
Contact: Victor Nadot, [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ name: "${TEST_TITLE}"
macros:
- TEST_TITLE: "functional test of CAENels fast PS 1K5"
P: "Sec-Sub(x):Dis-Dev-Idx:"
DELAY: 1
RETRY: 5
DELAY: 1
RETRY: 5
## not specific to power supply (user inputs)
# current
CURRENT: 0.1 # A
# ramp
RAMP_UP: 0.1 # A/s
RAMP_UP: 0.1 # A/s
DELAY_RAMP_UP: 5 # sec

## specific to power supply (won't change)
# ramp
SET_RAMP_UP: "IRampSet"
GET_RAMP_UP: "IRampRb"
GET_RAMP_UP: "IRampRb"
# regulation mode (current or voltage)
SET_REGULATION: "RegModeSet"
GET_REGULATION: "RegModeRb"
SET_REGULATION: "RegModeSet"
GET_REGULATION: "RegModeRb"
# on/off
SET_ON_OFF: "EnaCmd"
GET_ON_OFF: "EnaRb"
Expand Down Expand Up @@ -84,7 +84,7 @@ include:
SET_ON_OFF: ${SET_ON_OFF}
GET_ON_OFF: ${GET_ON_OFF}
ON_STATE: 1
DELAY_RAMP_UP: ${DELAY} # no ramp up here, waintoing for user setpoint (next move)
DELAY_RAMP_UP: ${DELAY} # no ramp up here, waintoing for user setpoint (next move)


# config current
Expand Down
42 changes: 21 additions & 21 deletions wetest/generic/specific/weTest_functional_basicPowerSupply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ name: "${TEST_TITLE}"
macros:
- TEST_TITLE: "functional test of DeltaESxxx"
P: "CEA:"
DELAY: 1
RETRY: 2
DELAY: 1
RETRY: 2
## not specific to power supply (user inputs)
# config
VOLTAGE: 2 # Volts
Expand All @@ -27,12 +27,12 @@ macros:
POLARITY: "Positive field"
DELAY_RAMP_UP: 1 # sec
# check desired output (measured value)
GET_DESIRED_OUTPUT: "IMes"
DESIRED_OUTPUT: ${CURRENT}
DESIRED_OUTPUT_MARGIN: 1 #%
GET_DESIRED_OUTPUT: "IMes"
DESIRED_OUTPUT: ${CURRENT}
DESIRED_OUTPUT_MARGIN: 1 #%


## specific to power supply (won't change)
## specific to power supply (won't change)
## but user can still change them if needed
# on/off
SET_ON_OFF: "PwrEnaCmd"
Expand All @@ -42,25 +42,25 @@ macros:
DELAY_RAMP_DOWN: 1 # sec
# voltage
SET_VOLTAGE: "USet"
GET_VOLTAGE: "URb"
GET_VOLTAGE: "URb"
# current
SET_CURRENT: "ISet"
GET_CURRENT: "IRb"
# UVL
SET_POLARITY: "BPosSet"
GET_POLARITY: "BPosRb"
# check CC/CV mode
GET_POLARITY: "BPosRb"
# check CC/CV mode
GET_OPERATION_MODE: "CcStat"
OPERATION_MODE: "CC"



include:
# init
- path: 'wetest/generic/weTest_functional_generic_power_supply_init.yaml'
TEST_TITLE: "init power supply ${P}"
P: ${P}
DELAY: ${DELAY}
DELAY: ${DELAY}
RETRY: ${RETRY}
# init
IGNORE_CLEAR: True
Expand All @@ -80,24 +80,24 @@ include:
RETRY: "${RETRY}"

# set target voltage
IGNORE_VOLTAGE: False
IGNORE_VOLTAGE: False
SET_VOLTAGE: "${SET_VOLTAGE}"
GET_VOLTAGE: "${GET_VOLTAGE}"
GET_VOLTAGE: "${GET_VOLTAGE}"
VOLTAGE: "${VOLTAGE}"
MARGIN_VOLTAGE: 0 # %

# set current
IGNORE_CURRENT: False
SET_CURRENT: "${SET_CURRENT}"
GET_CURRENT: "${GET_CURRENT}"
GET_CURRENT: "${GET_CURRENT}"
CURRENT: ${CURRENT}
MARGIN_CURRENT: 0 # %

# set polarity
IGNORE_POLARITY: $(IGNORE_POLARITY)
SET_POLARITY: ${SET_POLARITY}
GET_POLARITY: ${GET_POLARITY}
POLARITY: ${POLARITY}
POLARITY: ${POLARITY}


# check desired output
Expand All @@ -106,20 +106,20 @@ include:
P: "${P}"
DELAY: "${DELAY}"
RETRY: "${RETRY}"
# on/off
# on/off
IGNORE_ON_OFF: False
SET_ON_OFF: ${SET_ON_OFF}
GET_ON_OFF: ${GET_ON_OFF}
ON_STATE: ${ON_STATE}
DELAY_RAMP_UP: ${DELAY_RAMP_UP}
# check CC/CV mode
DELAY_RAMP_UP: ${DELAY_RAMP_UP}
# check CC/CV mode
IGNORE_CH_STATUS: ${IGNORE_CH_STATUS}
GET_CH_STATUS: ${GET_OPERATION_MODE}
CH_STATUS: ${OPERATION_MODE}
# check desired output (measured value)
IGNORE_MEASURED_VALUE: False
GET_MEASURED_VALUE: ${GET_DESIRED_OUTPUT}
IGNORE_MEASURED_VALUE: False
GET_MEASURED_VALUE: ${GET_DESIRED_OUTPUT}
MARGIN_MEASURED_VALUE: ${DESIRED_OUTPUT_MARGIN}
MEASURED_VALUE: ${DESIRED_OUTPUT}


Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ macros:
DELAY: 0.2 # sec: defaut delay (timeout between setter and checking getter)
RETRY: 2
# remote mode
IGNORE_REMOTE: True
IGNORE_REMOTE: True
SET_REMOTE: "LocRemSet"
REMOTE: 1
# set interclock
Expand All @@ -33,7 +33,7 @@ macros:
SET_RAMP_DOWN : "RDwnSet"
GET_RAMP_DOWN : "RDwnRb"
RAMP_DOWN: 50 # volt/sec or ms
# polarity
# polarity
IGNORE_POLARITY: True
SET_POLARITY: "BPosSet"
GET_POLARITY: "BPosRb"
Expand All @@ -43,33 +43,33 @@ macros:
SET_REGULATION: "RegModeSet"
GET_REGULATION: "RegModeRb"
REGULATION_STATE: 0 # 0:CV, 1:CC
# voltage
# voltage
IGNORE_VOLTAGE: True # by default, voltage tests are skipped
SET_VOLTAGE: "USet"
GET_VOLTAGE: "UMes" # should it be RBV or measure value her? TBD
VOLTAGE: 8 # volts
MARGIN_VOLTAGE: 0 # %
# voltage min
IGNORE_VOLTAGE_MIN: True
SET_VOLTAGE_MIN: "UNVThrSet"
SET_VOLTAGE_MIN: "UNVThrSet"
GET_VOLTAGE_MIN: "UNVThrRb"
MARGIN_VOLTAGE_MIN: 0 # %
VOLTAGE_MIN: 5 # volts
# voltage max
IGNORE_VOLTAGE_MAX: True
SET_VOLTAGE_MAX: "OVVThrSet"
SET_VOLTAGE_MAX: "OVVThrSet"
GET_VOLTAGE_MAX: "OVVThrRb"
MARGIN_VOLTAGE_MAX: 0 # %
VOLTAGE_MAX: 15 # volts
# current min
IGNORE_CURRENT_MIN: True
SET_CURRENT_MIN: "UNCThrSet"
SET_CURRENT_MIN: "UNCThrSet"
GET_CURRENT_MIN: "UNCThrRb"
MARGIN_CURRENT_MIN: 0 # %
CURRENT_MIN: 5 # A
# current max
IGNORE_CURRENT_MAX: True
SET_CURRENT_MAX: "OVCThrSet"
SET_CURRENT_MAX: "OVCThrSet"
GET_CURRENT_MAX: "OVCThrRb"
MARGIN_CURRENT_MAX: 0 # %
CURRENT_MAX: 15 # A
Expand Down
8 changes: 2 additions & 6 deletions wetest/gui/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,8 @@ class Tooltip:
see:
http://stackoverflow.com/questions/3221956/
what-is-the-simplest-way-to-make-tooltips-
in-tkinter/36221216#36221216
http://www.daniweb.com/programming/software-development/
code/484591/a-tooltip-class-for-tkinter
http://stackoverflow.com/questions/3221956/what-is-the-simplest-way-to-make-tooltips-in-tkinter/36221216#36221216
http://www.daniweb.com/programming/software-development/code/484591/a-tooltip-class-for-tkinter
- Originally written by vegaseat on 2014.09.09.
Expand Down
2 changes: 1 addition & 1 deletion wetest/resources/scenario_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ mapping:
type: int
desc: |
number of retry before marking test as failed,
defaults to config's `retry`, -1 for infinite number of retry
defaults to config's `retry`, -1 for infinite number of retry
2 changes: 1 addition & 1 deletion wetest/tests/macro-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@ tests:

- ${test_1}

- ${test_2}
- ${test_2}
2 changes: 1 addition & 1 deletion wetest/tests/scenario_range.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ tests:
step: 5
lin: 5
geom: 5
sort: reverse
sort: reverse
2 changes: 1 addition & 1 deletion wetest/tests/type-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ tests:
value: []

- name: 'single-value waveform issue'
message: pyepics get returns a float rather than a waveform, is that true for regular EPICS records as well ?
message: pyepics get returns a float rather than a waveform, is that true for regular EPICS records as well ?
commands:
- name: "single-value waveform"
setter: :UIncPwrMes-BPTR
Expand Down

0 comments on commit c34575c

Please sign in to comment.