From d63a1981cd5af6e79a5961d3485780fbd1ba1fd1 Mon Sep 17 00:00:00 2001 From: Ross Whitfield Date: Fri, 26 Aug 2022 11:21:48 -0400 Subject: [PATCH 1/2] Bump testing dependency versions --- .github/workflows/conda_env/environment_linux.yml | 2 +- .github/workflows/conda_env/environment_macos.yml | 2 +- .../workflows/conda_env/environment_static_analysis.yml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/conda_env/environment_linux.yml b/.github/workflows/conda_env/environment_linux.yml index c78266c8..bbde8404 100644 --- a/.github/workflows/conda_env/environment_linux.yml +++ b/.github/workflows/conda_env/environment_linux.yml @@ -6,6 +6,6 @@ dependencies: - pytest-timeout - psutil - mpi4py -- dask=2022.06.0 +- dask=2022.08.1 - dakota - coverage!=6.3 diff --git a/.github/workflows/conda_env/environment_macos.yml b/.github/workflows/conda_env/environment_macos.yml index d5a1f69e..07877bd5 100644 --- a/.github/workflows/conda_env/environment_macos.yml +++ b/.github/workflows/conda_env/environment_macos.yml @@ -5,5 +5,5 @@ dependencies: - pytest-cov - pytest-timeout - psutil -- dask=2022.06.0 +- dask=2022.08.1 - coverage!=6.3 diff --git a/.github/workflows/conda_env/environment_static_analysis.yml b/.github/workflows/conda_env/environment_static_analysis.yml index 6751c489..bdaa7ac3 100644 --- a/.github/workflows/conda_env/environment_static_analysis.yml +++ b/.github/workflows/conda_env/environment_static_analysis.yml @@ -3,9 +3,9 @@ channels: - conda-forge dependencies: - python=3.8 -- flake8=4.0.1 -- pylint=2.14.2 +- flake8=5.0.4 +- pylint=2.15.0 - bandit=1.7.4 -- codespell=2.1.0 -- dask=2022.06.0 +- codespell=2.2.1 +- dask=2022.08.1 - pytest From 53cdace1fd6490e9feafdb28de481f68140ad6b7 Mon Sep 17 00:00:00 2001 From: Ross Whitfield Date: Fri, 26 Aug 2022 11:31:02 -0400 Subject: [PATCH 2/2] Fix new warnings --- components/drivers/elwasif/elwasif_driver.py | 2 +- doc/examples/component_skeleton.py | 4 ++-- doc/user_guides/config_file.rst | 2 +- ipsframework/ipsLogging.py | 2 +- ipsframework/services.py | 2 +- tests/components/drivers/basic_concurrent1.py | 2 +- tests/components/drivers/basic_serial1.py | 2 +- tests/components/drivers/basic_serial2.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/drivers/elwasif/elwasif_driver.py b/components/drivers/elwasif/elwasif_driver.py index 21d96fdd..784f9ada 100755 --- a/components/drivers/elwasif/elwasif_driver.py +++ b/components/drivers/elwasif/elwasif_driver.py @@ -33,7 +33,7 @@ def step(self, timestamp=0): rfComp = services.get_port('RF_IC') profAdvanceComp = services.get_port('PROFILE_ADVANCE') - if(rfComp is None or profAdvanceComp is None): + if rfComp is None or profAdvanceComp is None: print('Error accessing physics components') sys.exit(1) diff --git a/doc/examples/component_skeleton.py b/doc/examples/component_skeleton.py index a6e4c8f9..698733f0 100644 --- a/doc/examples/component_skeleton.py +++ b/doc/examples/component_skeleton.py @@ -179,7 +179,7 @@ def step(self, timeStamp): power_ic = ps.variables['power_ic'].getValue()[0] ps.close() print('power = ', power_ic) - if(-0.02 < power_ic < 0.02): + if -0.02 < power_ic < 0.02: retcode = subprocess.call([zero_RF_IC_power, cur_state_file]) if (retcode != 0): print('Error executing ', prepare_input) @@ -197,7 +197,7 @@ def step(self, timeStamp): # retain power from previous time step i.e. leave sources untouched in the state. # However power_ic needs to be reset back to positive - elif(power_ic < -0.02): + elif power_ic < -0.02: print('continuing power from previous time step') ps.variables['power_ic'].assignValue(-power_ic) ps.close() diff --git a/doc/user_guides/config_file.rst b/doc/user_guides/config_file.rst index d3223192..c7626003 100644 --- a/doc/user_guides/config_file.rst +++ b/doc/user_guides/config_file.rst @@ -45,7 +45,7 @@ These items describe this configuration and is used for describing and locating \*\* Mandatory items: *SIM_ROOT*, *SIM_NAME*, *LOG_FILE* -*RUN_ID*, *TOKOMAK_ID*, *SHOT_NUMBER* - identifiers for the simulation that are helpful for SWIM users. They ore often used to form a hierarchical name for the simulation, identifying related runs. +*RUN_ID*, *TOKOMAK_ID*, *SHOT_NUMBER* - identifiers for the simulation that are helpful for SWIM users. They are often used to form a hierarchical name for the simulation, identifying related runs. *OUTPUT_PREFIX* - used to prevent collisions and overwriting of different simulations using the same *SIM_ROOT*. diff --git a/ipsframework/ipsLogging.py b/ipsframework/ipsLogging.py index 73a0b026..77c78cb1 100644 --- a/ipsframework/ipsLogging.py +++ b/ipsframework/ipsLogging.py @@ -131,7 +131,7 @@ def __run__(self): self.add_sim_log(tokens[1], tokens[2]) elif tokens[0] == 'END_SIM': # Expecting Message 'END_SIM log_pipe_name' log_pipe_name = tokens[1] - for fileno, (recvr, _, f_name) in list(self.log_map.items()): + for fileno, (recvr, _, f_name) in self.log_map.copy().items(): if f_name == log_pipe_name: del recvr del self.log_map[fileno] diff --git a/ipsframework/services.py b/ipsframework/services.py index f32fe253..9c06e789 100644 --- a/ipsframework/services.py +++ b/ipsframework/services.py @@ -1770,7 +1770,7 @@ def publish(self, topicName, eventName, eventBody): def subscribe(self, topicName, callback): """ - Subscribe to topic *topicName* on the IPS event service and register *callback* as the method to be invoked whem an event is published to that topic. + Subscribe to topic *topicName* on the IPS event service and register *callback* as the method to be invoked when an event is published to that topic. """ if not topicName.startswith('_IPS'): topicName = self.sim_name + '_' + topicName diff --git a/tests/components/drivers/basic_concurrent1.py b/tests/components/drivers/basic_concurrent1.py index eff21d3e..5effb96f 100644 --- a/tests/components/drivers/basic_concurrent1.py +++ b/tests/components/drivers/basic_concurrent1.py @@ -31,7 +31,7 @@ def step(self, timestamp=0.0, **keywords): w3 = self.services.get_port('WORKER3') # should we do something different here????? a try block? - if(w1 is None or w2 is None or w3 is None): + if w1 is None or w2 is None or w3 is None: print('Error accessing physics components') raise Exception('Error accessing physics components') diff --git a/tests/components/drivers/basic_serial1.py b/tests/components/drivers/basic_serial1.py index 332132c2..e9b07f40 100644 --- a/tests/components/drivers/basic_serial1.py +++ b/tests/components/drivers/basic_serial1.py @@ -29,7 +29,7 @@ def step(self, timestamp=0.0, **keywords): w3 = self.services.get_port('WORKER3') # should we do something different here????? a try block? - if(w1 is None or w2 is None or w3 is None): + if w1 is None or w2 is None or w3 is None: print('Error accessing physics components') raise Exception('Error accessing physics components') diff --git a/tests/components/drivers/basic_serial2.py b/tests/components/drivers/basic_serial2.py index 13ffc414..ee4d460d 100644 --- a/tests/components/drivers/basic_serial2.py +++ b/tests/components/drivers/basic_serial2.py @@ -29,7 +29,7 @@ def step(self, timestamp=0.0, **keywords): w3 = self.services.get_port('WORKER3') # should we do something different here????? a try block? - if(w1 is None or w2 is None or w3 is None): + if w1 is None or w2 is None or w3 is None: print('Error accessing physics components') raise Exception('Error accessing physics components')