-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure.text: Support non-ASCII characters in the 'text' parameter #2638
Conversation
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)Report last updated at commit 05f2299 |
Suddenly it works for me. It may be some network issues yesterday. |
Co-authored-by: Yvonne Fröhlich <[email protected]>
pygmt/src/text.py
Outdated
@@ -223,7 +230,9 @@ def text_( | |||
|
|||
# Append text at last column. Text must be passed in as str type. | |||
if kind == "vectors": | |||
extra_arrays.append(np.atleast_1d(text).astype(str)) | |||
extra_arrays.append( | |||
list(map(non_ascii_to_octal, np.atleast_1d(text).astype(str))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a list of numpy arrays, instead of being just a numpy array? Is there a way to keep it as a numpy array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to np.vectorize
in 85a0926.
pygmt/tests/test_text.py
Outdated
fig.text(position="TL", text="position-text:°α") | ||
fig.text(x=1, y=1, text="xytext:°α") | ||
fig.text(x=[5, 5], y=[3, 5], text=["xytext1:°α", "xytext2:°α"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mix in some Symbol and ZapfDingbats characters too from https://docs.generic-mapping-tools.org/latest/cookbook/octal-codes.html#octal-codes-symbol-zap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in adf6eda.
The new test fails, because I generated the baseline image using gs 9.56.1 but our CI is still using gs 9.54, but why can't the CI use gs 9.56.1? |
Ghostscript 9.56.1 was just released 3 days ago on conda-forge - https://anaconda.org/conda-forge/ghostscript/files?version=9.56.1. I can also install 9.56.1 on my system, so not sure why CI still uses gs 9.54, let me check the dependency graph. |
Actually, maybe we don't want gs 9.56.1 for now 😅 I just ran |
OK. I think we can use gs 9.54 now. FYI, gs 10.02.0 is likely the next gs version that doesn't have serious bugs (GenericMappingTools/gmt#7336 (comment)) and it's likely to be released soon (rc1 is already been released). I think we should only update these baseline images when gs 10.02.0 is out. |
Sounds good, better to update the baseline images once for gs 10.02 rather than twice, we can track the ghostscript 10.0 release on conda-forge at conda-forge/ghostscript-feedstock#26. Just realized that you put out the gs 9.56.1 package 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. The 16 failing tests on CI will be fixed in #2636, so can safely ignore.
Tenth minor release of PyGMT. * Add changelog entry to version switcher * Update compatibility table * Update citation * Add draft changelog * Add full names of contributors to changelog * Add two highlight bullet points * Combine non-ASCII character PRs #2638 and #2584 into one highlight point * Swap author positions for Dongdong and Leo * Change release date to 20230902 * Move Yvonne up a few spots --------- Co-authored-by: Yvonne Fröhlich <[email protected]> Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Michael Grund <[email protected]>
Description of proposed changes
Address #2204 following #2584.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version