-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add aliases for Angstrom to Units.pm #762
Conversation
@duffee We think that we should probably standardize to SI units. Can you include in this PR that A will now be ampere and we'll keep both "Angstrom" and "angstrom"? |
Note that Å is an available unicode character for angstrom, and could maybe be in play here. |
@pstaabp I've changed A to from angstrom to ampere, leaving amp as the fundamental unit. I'll prepare a separate PR for the documentation changes required in webwork2. I think it's a bad idea to add the Å because unicode is hard generally, but I admire Alex's courage, so it's in! |
I know what you mean, but PG should be supporting it now. Already (if you enable it in localOverrides.conf) you can use things like π, ∞, and ≤ in answers. Students often do, copy-pasting a character from somewhere into an input field. We have all that enabled on our server and it works. But to my knowledge this would be the first non-ascii character in the units. |
The workflow does not need to be changed. @duffee needs to work into the way that unit tests for PG are supposed to be set up and quit deleting the |
@pstaabp: By the way, you can also just do |
Ah, sorry @duffee. You didn't delete those lines. The lines just are not present in this pull request. You need to rebase onto the develop branch or merge the develop branch into this one (whichever you prefer). |
There are still some failing tests in |
I just added:
to the sample problem which opens the help for units. I'm seeing the old version: even though the help code clearly changed from "A" to "angstrom". Is this a caching issue? I just flushed my cache and checked a rarely used browser and still see "A" as the basic unit. |
AnswerFormatHelp.pl is another instance of a macro that should be deprecated. |
+1 |
Using the proper format of AnswerFormatHelp worked fine I used:
and it does show the updated file. Do mean deprecate the |
@pstaabp: What? ... I mean what??????? What are you saying? |
I definitely mean deprecate the AnswerFormatHelp.pl macro that is incorrect, obsolete, and replaced with better functionality by helpLink. |
Looking at the AnswerFormatHelp.pl code, yes. I agree. It's in 8000+ OPL/Contrib problems. That'll be some fun changes. So the update to the unit help should be in |
Removing it from OPL and Contrib problems may not be fun, but it doesn't change the fact that the macro is obsolete. What should be done is the macro updated to call helpLink, and marked as deprecated. Newly written problems should not use it. |
@duffee: The tests that are failing after develop is merged into this branch are tests that I added that use angstroms. They use the old |
The SI symbol for the ampere is "A", which PG uses to mean Angstrom. To facilitate the migration of the Angstrom unit from "A" to "Angstrom" (or something else), this change adds in two aliases so that documentation and code can be updated before a breaking change is made.
This is a breaking change for problems that use A as angstrom. Add in the unicode character Å \x{00C5} to Units.pm as an alias for angstrom. Add test for A as ampere and allow unit names to match a unicode character
Make the help file consistent with the code change A is amp not angstrom
Rebase onto develop and fix tests that use A for angstrom
72c5e81
to
bd97de5
Compare
I forgot to mention the file |
Needs to be the same as Entering-Units.html
Looks like the duplication is also the case for Changes made to |
Yeah, those three are duplicated. I did think about using symlinks. That would work fine. Although, I really would like to delete the duplicates. I just need to figure out if there really is a need for them. It comes down to the question of does anyone directly use the help files by URL, or are the files only used by their helpLink alias? If no one uses them directly, then they can be removed. The PDE-notation.html file does not have an helpLink alias. So the only way it can be used is by direct URL. So at least one file must be used that way (or no one uses it). |
After finding and changing all the files in the repo that use those links, a decent deprecation strategy would be to change the file to note that the URL has been deprecated, instructions on how to update the link in the user's source and provide a link to click through to the surviving page. That should catch anyone who's bookmarked the page and after a year delete the file and listen for the 404's. |
We don't need to worry about someone bookmarking these. They are not served as complete pages. They are embedded html. So we really only need to worry about authors using the files directly by URL, rather than by the helpLink alias. |
The SI symbol for the ampere is "A", which PG uses to mean Angstrom (unit of length).
To facilitate the migration of the Angstrom unit from "A" to "Angstrom" (or something else), this change adds in two aliases so that documentation and code can be updated before any breaking changes are made.
I put this PR up here for discussion about #743 . I've added both upper and lower case for the unit for comparison, although I think it would be better to stick with one or the other.