Repository: sympy/sympy

Issue:
ASCII printer generates Unicode (at least in physics.vector)
As noted in https://github.com/sympy/sympy/pull/15849 the printing function in physics.vector adds dots on top of variables to indicate derivatives (Newton style). However, it seems like these are not properly converted to ASCII later when the ASCII version is derived. This should be sorted out in pretty_symbology and replace the dots with a proper number of `'`.

Note that there are currently tests that will have to be changed, e.g. https://github.com/sympy/sympy/blob/cb8a524e930266fe2f4cda39d7d0b1523c4fa38b/sympy/physics/vector/tests/test_printing.py#L239

where the expected result should be `'omega\'\'\' n_x'` (or `"omega''' n_x"` which may be easier to read and type...).

Discussion:

Patch:
diff --git a/sympy/physics/vector/printing.py b/sympy/physics/vector/printing.py
index be74eaa565..fa39edd2fa 100644
--- a/sympy/physics/vector/printing.py
+++ b/sympy/physics/vector/printing.py
@@ -197,10 +197,15 @@ def _print_Derivative(self, deriv):
                 4 : u"\N{COMBINING FOUR DOTS ABOVE}"}
 
         d = pform.__dict__
-
-        d['picture'] = [center_accent(d['picture'][0], dots[dot_i])]
+        #if unicode is false then calculate number of apostrophes needed and add to output
+        if not self._use_unicode:
+            apostrophes = ""
+            for i in range(0, dot_i):
+                apostrophes += "'"
+            d['picture'][0] += apostrophes + "(t)"
+        else:
+            d['picture'] = [center_accent(d['picture'][0], dots[dot_i])]
         d['unicode'] =  center_accent(d['unicode'], dots[dot_i])
-
         return pform
 
     def _print_Function(self, e):


Test patch:
diff --git a/sympy/physics/vector/tests/test_printing.py b/sympy/physics/vector/tests/test_printing.py
index 520776b5a0..8a54b2afc9 100644
--- a/sympy/physics/vector/tests/test_printing.py
+++ b/sympy/physics/vector/tests/test_printing.py
@@ -222,28 +222,31 @@ def test_issue_13354():
     assert ascii_vpretty(z) == expected
 
 def test_vector_derivative_printing():
-    # First order tested above
+    # First order
+    v = omega.diff() * N.x
+    assert unicode_vpretty(v) == u('ω̇ n_x')
+    assert ascii_vpretty(v) == u("omega'(t) n_x")
 
     # Second order
     v = omega.diff().diff() * N.x
 
     assert v._latex() == r'\ddot{\omega}\mathbf{\hat{n}_x}'
     assert unicode_vpretty(v) == u('ω̈ n_x')
-    assert ascii_vpretty(v) == u('omëga n_x')
+    assert ascii_vpretty(v) == u("omega''(t) n_x")
 
     # Third order
     v = omega.diff().diff().diff() * N.x
 
     assert v._latex() == r'\dddot{\omega}\mathbf{\hat{n}_x}'
     assert unicode_vpretty(v) == u('ω⃛ n_x')
-    assert ascii_vpretty(v) == u('ome⃛ga n_x')
+    assert ascii_vpretty(v) == u("omega'''(t) n_x")
 
     # Fourth order
     v = omega.diff().diff().diff().diff() * N.x
 
     assert v._latex() == r'\ddddot{\omega}\mathbf{\hat{n}_x}'
     assert unicode_vpretty(v) == u('ω⃜ n_x')
-    assert ascii_vpretty(v) == u('ome⃜ga n_x')
+    assert ascii_vpretty(v) == u("omega''''(t) n_x")
 
     # Fifth order
     v = omega.diff().diff().diff().diff().diff() * N.x