Repository: catalystneuro/neuroconv

Issue:
[Feature]: Enable pretty printing for the DeepDict
### What would you like to see added to NeuroConv?

When printing DeepDict in the Juptyer terminal, I'd love for the dictionary to be broken up across lines instead of a single line that requires horizontal scrolling

### Is your feature request related to a problem?

_No response_

### Do you have any interest in helping implement the feature?

Yes.

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://github.com/catalystneuro/neuroconv/blob/main/.github/CODE_OF_CONDUCT.rst)
- [x] Have you ensured this bug was not already [reported](https://github.com/catalystneuro/neuroconv/issues)?

Discussion:
@h-mayorquin: The problem is that Jupyter recognizes standard Python types and pretty prints them but it does not recognize our object. We can wrap the ipython method that jupyter uses to achieve this. 

Solution patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2f0a9136..08db6c06 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,10 +15,10 @@
 * `AudioInterface` Adding support for IEEE float in WAV format [PR #1325](https://github.com/catalystneuro/neuroconv/pull/1325)
 * Added a RecordingInterface for WhiteMatter ephys data [PR #1297](https://github.com/catalystneuro/neuroconv/pull/1297) [PR #1333](https://github.com/catalystneuro/neuroconv/pull/1333)
 * Improved `ScanImageInteface` to support both single and multi-file data [PR #1330](https://github.com/catalystneuro/neuroconv/pull/1330)
+* `DeepDict` now behaves as a python dict when printed in notebooks [PR #1351](https://github.com/catalystneuro/neuroconv/pull/1351)
 * Enable chunking for `InternalVideoInterface` [PR #1338](https://github.com/catalystneuro/neuroconv/pull/1338)
 * `ImageSeries` and `TwoPhotonSeries` now are chunked by default even if the data is passed as a plain array [PR #1338](https://github.com/catalystneuro/neuroconv/pull/1338)
 
-
 ## Improvements
 * Make metadata optional in `NWBConverter.add_to_nwbfile` [PR #1309](https://github.com/catalystneuro/neuroconv/pull/1309)
 * Add installation instructions on the documentation for `neuroconv` [PR #1344](https://github.com/catalystneuro/neuroconv/pull/1344)
diff --git a/src/neuroconv/utils/dict.py b/src/neuroconv/utils/dict.py
index 4cf65e5c..5bab9236 100644
--- a/src/neuroconv/utils/dict.py
+++ b/src/neuroconv/utils/dict.py
@@ -255,4 +255,10 @@ class DeepDict(defaultdict):
         return DeepDict(deepcopy(self.to_dict()))
 
     def __repr__(self) -> str:
-        return "DeepDict: " + dict.__repr__(self.to_dict())
+        return f"DeepDict({repr(self.to_dict())})"
+
+    def _repr_pretty_(self, p, cycle):
+        "This is used by IPython to pretty-print the object and used here to achieve printing parity with dicts."
+        p.text("DeepDict(\n")
+        p.pretty(self.to_dict())
+        p.text("\n)")


Test patch:
diff --git a/tests/test_minimal/test_utils/test_dict.py b/tests/test_minimal/test_utils/test_dict.py
index d3026991..24b8015b 100644
--- a/tests/test_minimal/test_utils/test_dict.py
+++ b/tests/test_minimal/test_utils/test_dict.py
@@ -36,7 +36,7 @@ class TestDeepDict(unittest.TestCase):
         self.assertIsInstance(dd["a"]["b"], DeepDict)
 
     def test_repr(self):
-        expected_repr = "DeepDict: {'a': {'b': {'c': 42}}}"
+        expected_repr = "DeepDict({'a': {'b': {'c': 42}}})"
         self.assertEqual(repr(self.dd), expected_repr)
 
     def test_deep_update(self):