now[bot]: 
This pull request is being automatically deployed with ZEIT Now ([learn more](https://zeit.co/docs/v2/integrations/now-for-github?utm_source=automated&utm_medium=github&utm_campaign=now_bot)).
To see the status of your deployment, click on the icon next to each commit.
	
diff --git a/vg/core.py b/vg/core.py
index 0c3867b..273ddc9 100644
--- a/vg/core.py
+++ b/vg/core.py
@@ -503,14 +503,14 @@ def apex(points, along):
             interest.
 
     Returns:
-        np.ndarray: A `3x1` point taken from `points`.
+        np.ndarray: A copy of a point taken from `points`.
     """
     if points.ndim != 2 or points.shape[1] != 3:
         raise ValueError("Invalid shape %s: apex expects nx3" % (points.shape,))
     if along.shape != (3,):
         raise ValueError("along should be a 3x1 vector")
     coords_on_axis = points.dot(along)
-    return points[np.argmax(coords_on_axis)]
+    return points[np.argmax(coords_on_axis)].copy()
 
 
 def nearest(from_points, to_point, ret_index=False):

`vg.apex()` should copy instead of returning a view
diff --git a/vg/test_apex.py b/vg/test_apex.py
index 478430c..605aa67 100644
--- a/vg/test_apex.py
+++ b/vg/test_apex.py
@@ -50,3 +50,23 @@ def test_apex():
 
     with pytest.raises(ValueError, match="along should be a 3x1 vector"):
         vg.apex(points, along=points)
+
+
+def test_apex_returns_a_copy():
+    points = np.array(
+        [
+            [-0.97418884, -0.79808404, -0.18545491],
+            [0.60675227, 0.32673201, -0.20369793],
+            [0.67040405, 0.19267665, -0.56983579],
+            [-0.68038753, -0.90011588, 0.4649872],
+            [-0.62813991, -0.23947753, 0.07933854],
+            [0.26348356, 0.23701114, -0.38230596],
+            [0.08302473, 0.2784907, 0.09308946],
+            [0.58695587, -0.33253376, -0.33493078],
+            [-0.39221704, -0.45240036, 0.25284163],
+            [0.46270635, -0.3865265, -0.98106526],
+        ]
+    )
+    result = vg.apex(points, along=vg.basis.x)
+    result[1] = 5.0
+    np.testing.assert_array_equal(points[2], [0.67040405, 0.19267665, -0.56983579])

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
exceptiongroup==1.2.2
iniconfig==2.1.0
numpy==2.0.2
packaging==24.2
pluggy==1.5.0
pytest==8.3.5
tomli==2.2.1
-e git+https://github.com/lace/vg.git@4bbfb179da51a24f23bcb48c57f22b19154b3fe1#egg=vg

name: vg
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - numpy==2.0.2
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - tomli==2.2.1
prefix: /opt/conda/envs/vg

vg/test_apex.py::test_apex_returns_a_copy
vg/test_apex.py::test_apex
vg/core.py
vg/core.py