Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: I think using anndata to save the results of reg1 and reg2 is not appropriate, as anndata was not designed to store such data. Moreover, reg2 now gives me the following error:
Traceback (most recent call last):
File "/viash_automount/tmp/viash-run-regression_2-jvcvex.py", line 66, in
output = ad.AnnData(
^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anndata/_core/anndata.py", line 291, in init
self._init_as_actual(
File "/usr/local/lib/python3.11/site-packages/anndata/_core/anndata.py", line 475, in _init_as_actual
{'dataset_id': 'scgen_pearson', 'method_id': 'reg2-None', 'metric_ids': array(['static-theta-0.0', 'static-theta-0.5', 'static-theta-1.0', 'Mean'],
dtype=object), 'metric_values': array([0.03201749, 0.24454853, 0.51412799, 0.26356467])}
X = np.array(X, dtype, copy=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Unable to avoid copy while creating an array as requested.
If using
np.array(obj, copy=False)
replace it withnp.asarray(obj)
to allow a copy when needed (no behavior change in NumPy 1.x).For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.
A simpler file format such as json or csv (as it used to be) would be more appropriate.