Repository: petrobras/ross (language: python)

Issue:
Upgrade to numpy 2.0
We need to upgrade ross to work with numpy 2.0.
This means that we will have to change our test matrix so that we will only support python >= 3.9.


Discussion / hints:
### For the record:

It appears that in NumPy 2.0.0, the representation `repr` of NumPy scalars changed, causing conflicts when running pytest.

See: [NumPy 2.0.0 Release Notes](https://numpy.org/devdocs/release/2.0.0-notes.html#representation-of-numpy-scalars-changed)


### Possible solutions:

1. Create a _conftest.py_ file with a pytest hook to modify options for doctests:

      ```python
      def pytest_configure(config):
          np.set_printoptions(legacy='1.25')
      ```
      This will ensure compatibility with the previous NumPy behavior.


2. Update all doctests to align with the new NumPy behavior.

Fix patch:
diff --git a/requirements.txt b/requirements.txt
index 1de0f4f44..7d3cce629 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 
-numpy<2.0.0
+numpy
 scipy
 toml>=0.10.1
 pandas>=0.23


Test patch:
diff --git a/ross/conftest.py b/ross/conftest.py
new file mode 100644
index 000000000..504d905a2
--- /dev/null
+++ b/ross/conftest.py
@@ -0,0 +1,9 @@
+import numpy as np
+import pytest
+
+
+# pytest hook to modify options for doctests
+def pytest_configure(config):
+    numpy_version = int(np.__version__.split(".")[0])
+    if numpy_version >= 2:
+        np.set_printoptions(legacy="1.25")