Repository: IBM/aihwkit (language: python)

Issue:
Bump requirements-dev, changelog
## Related issues

<!-- Link to the issues that are related to this pull request. -->

## Description

Small post-0.3.0 release update in order to mark the start of the next version, taking the time to refresh the development dependencies.

## Details

<!-- A more elaborate description of the changes, if needed. -->



Discussion / hints:

Fix patch:
diff --git a/requirements-dev.txt b/requirements-dev.txt
index a9ef49e4..198f2cc3 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,5 +1,5 @@
 mypy==0.812
 pycodestyle==2.7.0
-pylint==2.6.0
+pylint==2.8.2
 pytest==6.2.3
 parameterized==0.8.1


Test patch:
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 5614b29a..cc437eb5 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -103,14 +103,12 @@ def test_save_load_state_dict_train(self):
             assert_raises(AssertionError, assert_array_almost_equal, model_biases, tile_biases)
 
         # Save the model to a file.
-        file = TemporaryFile()
-        save(model.state_dict(), file)
-
-        # Create a new model and load its state dict.
-        file.seek(0)
-        new_model = self.get_layer()
-        new_model.load_state_dict(load(file))
-        file.close()
+        with TemporaryFile() as file:
+            save(model.state_dict(), file)
+            # Create a new model and load its state dict.
+            file.seek(0)
+            new_model = self.get_layer()
+            new_model.load_state_dict(load(file))
 
         # Compare the new model weights and biases. they should now be in sync
         (new_model_weights, new_model_biases,
@@ -134,13 +132,11 @@ def test_save_load_model(self):
             assert_array_almost_equal(model_biases, tile_biases)
 
         # Save the model to a file.
-        file = TemporaryFile()
-        save(model, file)
-
-        # Load the model.
-        file.seek(0)
-        new_model = load(file)
-        file.close()
+        with TemporaryFile() as file:
+            save(model, file)
+            # Load the model.
+            file.seek(0)
+            new_model = load(file)
 
         # Compare the new model weights and biases.
         (new_model_weights, new_model_biases,
@@ -165,13 +161,11 @@ def test_save_load_meta_parameter(self):
         model = self.get_layer(rpu_config=rpu_config)
 
         # Save the model to a file.
-        file = TemporaryFile()
-        save(model, file)
-
-        # Load the model.
-        file.seek(0)
-        new_model = load(file)
-        file.close()
+        with TemporaryFile() as file:
+            save(model, file)
+            # Load the model.
+            file.seek(0)
+            new_model = load(file)
 
         # Assert over the new model tile parameters.
         parameters = new_model.analog_tile.tile.get_parameters()
@@ -186,13 +180,11 @@ def test_save_load_hidden_parameters(self):
         hidden_parameters = model.analog_tile.tile.get_hidden_parameters()
 
         # Save the model to a file.
-        file = TemporaryFile()
-        save(model, file)
-
-        # Load the model.
-        file.seek(0)
-        new_model = load(file)
-        file.close()
+        with TemporaryFile() as file:
+            save(model, file)
+            # Load the model.
+            file.seek(0)
+            new_model = load(file)
 
         # Assert over the new model tile parameters.
         new_hidden_parameters = new_model.analog_tile.tile.get_hidden_parameters()
@@ -206,13 +198,11 @@ def test_save_load_alpha_scale(self):
         model.analog_tile.tile.set_alpha_scale(alpha)
 
         # Save the model to a file.
-        file = TemporaryFile()
-        save(model, file)
-
-        # Load the model.
-        file.seek(0)
-        new_model = load(file)
-        file.close()
+        with TemporaryFile() as file:
+            save(model, file)
+            # Load the model.
+            file.seek(0)
+            new_model = load(file)
 
         # Assert over the new model tile parameters.
         alpha_new = new_model.analog_tile.tile.get_alpha_scale()
@@ -226,13 +216,11 @@ def test_save_load_weight_scaling_omega(self):
         self.assertNotEqual(alpha, 1.0)
 
         # Save the model to a file.
-        file = TemporaryFile()
-        save(model, file)
-
-        # Load the model.
-        file.seek(0)
-        new_model = load(file)
-        file.close()
+        with TemporaryFile() as file:
+            save(model, file)
+            # Load the model.
+            file.seek(0)
+            new_model = load(file)
 
         # Assert over the new model tile parameters.
         alpha_new = new_model.analog_tile.tile.get_alpha_scale()
@@ -245,14 +233,12 @@ def test_save_load_state_dict_hidden_parameters(self):
         hidden_parameters = model.analog_tile.tile.get_hidden_parameters()
 
         # Save the model to a file.
-        file = TemporaryFile()
-        save(model.state_dict(), file)
-
-        # Load the model.
-        file.seek(0)
-        new_model = self.get_layer()
-        new_model.load_state_dict(load(file))
-        file.close()
+        with TemporaryFile() as file:
+            save(model.state_dict(), file)
+            # Load the model.
+            file.seek(0)
+            new_model = self.get_layer()
+            new_model.load_state_dict(load(file))
 
         # Assert over the new model tile parameters.
         new_hidden_parameters = new_model.analog_tile.tile.get_hidden_parameters()