Repository: yt-project/yt

Issue:
region arithmetic funniness
<!--To help us understand and resolve your issue, please fill out the form to
the best of your ability.-->
<!--You can feel free to delete the sections that do not apply.-->

### Bug report

**Bug summary**

If I mix `ds.domain_left_edge` with a list composed of components of `ds.domain_*`, I get a `YTUnitOperationError`


**Code for reproduction**


<!-- If you need to use a data file to trigger the issue you're having, consider
using one of the datasets from the yt data hub (http://yt-project.org/data). If
your issue cannot be triggered using a public dataset, you can use the yt
curldrop (https://docs.hub.yt/services.html#curldrop) to share data
files. Please include a link to the dataset in the issue if you use the
curldrop.-->

```python
import numpy as np
import yt

plotfile = "smallplt00595"

ds = yt.load(plotfile)



center = ds.domain_center
lower_left = ds.domain_left_edge
upper_right = ds.domain_right_edge

ll = [lower_left[0], lower_left[1], lower_left[2]]
rr = [center[0], upper_right[1], upper_right[2]]
region1 = ds.box(ll, rr)
print(region1)

ll = lower_left
rr = [center[0], upper_right[1], upper_right[2]]

region2 = ds.box(ll, rr)
```

**Actual outcome**

<!--The output produced by the above code, which may be a screenshot, console
output, etc.-->

```
$ python3 test_region.py
yt : [INFO     ] 2020-04-25 14:16:34,930 Parameters: current_time              = 7.24422756567562
yt : [INFO     ] 2020-04-25 14:16:34,930 Parameters: domain_dimensions         = [512 512 512]
yt : [INFO     ] 2020-04-25 14:16:34,930 Parameters: domain_left_edge          = [-5.12e+09 -5.12e+09 -5.12e+09]
yt : [INFO     ] 2020-04-25 14:16:34,930 Parameters: domain_right_edge         = [5.12e+09 5.12e+09 5.12e+09]
YTRegion (smallplt00595): , center=[-2.56e+09  0.00e+00  0.00e+00] cm, left_edge=[-5.12e+09 -5.12e+09 -5.12e+09] cm, right_edge=[0.00e+00 5.12e+09 5.12e+09] cm
Traceback (most recent call last):
  File "test_region.py", line 22, in <module>
    region2 = ds.box(ll, rr)
  File "/raid/zingale/development/yt/yt/data_objects/static_output.py", line 854, in box
    c = (left_edge + right_edge)/2.0
  File "/raid/zingale/development/yt/yt/units/yt_array.py", line 1414, in __array_ufunc__
    inps, units, ufunc, ret_class)
  File "/raid/zingale/development/yt/yt/units/yt_array.py", line 174, in handle_preserve_units
    raise YTUnitOperationError(ufunc, *units)
yt.utilities.exceptions.YTUnitOperationError: The <ufunc 'add'> operator for YTArrays with units (code_length) and (dimensionless) is not well defined.
```

**Expected outcome**

<!--A description of the expected outcome from the code snippet-->
<!--If this used to work in an earlier version of yt, please note the
version it used to work on-->

I would expect to for both of these ways to compose a region to work.

**Version Information**
<!--Please specify your platform and versions of the relevant libraries you are
using:-->
  * Operating System: Fedora 31
  * Python Version: 3.7.6
  * yt version: 3.7.dev0
  * Other Libraries (if applicable): numpy 1.17.4

<!--Please tell us how you installed yt and python e.g., from source,
pip, conda. If you installed from conda, please specify which channel you used
if not the default-->

yt built from source (`python setup.py develop`)


Discussion:

Resolving patch:
diff --git a/yt/data_objects/static_output.py b/yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -847,10 +847,12 @@ def box(self, left_edge, right_edge, **kwargs):
         # but need to check if left_edge or right_edge is a
         # list or other non-array iterable before calculating
         # the center
-        if not isinstance(left_edge, np.ndarray):
-            left_edge = np.array(left_edge, dtype='float64')
-        if not isinstance(right_edge, np.ndarray):
-            right_edge = np.array(right_edge, dtype='float64')
+        if isinstance(left_edge[0], YTQuantity):
+            left_edge = YTArray(left_edge)
+            right_edge = YTArray(right_edge)
+
+        left_edge = np.asanyarray(left_edge, dtype='float64')
+        right_edge = np.asanyarray(right_edge, dtype='float64')
         c = (left_edge + right_edge)/2.0
         return self.region(c, left_edge, right_edge, **kwargs)
 


Test patch: