-
Notifications
You must be signed in to change notification settings - Fork 168
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
Update .trn files to be PVL compliant #5566
base: dev
Are you sure you want to change the base?
Update .trn files to be PVL compliant #5566
Conversation
4317c75
to
c7e12aa
Compare
It feels like these are breaking changes to ISIS. I didn't see this discussion in the referenced issue. I do agree it should be fixed. Will ISIS still support the old format? In other words, is ISIS going to enforce this format by erroring out if an Auto/Optional/Debug keyword is encountered without an Consider a change to the ISIS cube file format this is not backward compatible. Would this be a breaking change? External developers who are working on new, or have existing, ISIS instruments will be required to modify all their translations files accordingly. This format has been in use in ISIS since its beginning. Is there intent to make a code change to enforce this long accepted practice in ISIS? |
@KrisBecker No code changes are planned and all tests using the updated trn files have passed. This change was sparked by #5484, and is correct that parsing the The change is to ensure that others reading the PVL files get the correct result, and so any stand alone keywords need some kind of value. W.r.t. requiring external devs to make changes to the |
So what is your plan to prevent non-compliant .trn files being submitted into ISIS? Clearly these files are being used by external s/w systems. If you have no tests to detect these situations, this PR does not fix the OP's bug. |
After some thought I have four ideas (not all of which are independent of each other):
This would be the hardest and most time consuming fix, with potential to break old PVL produced by ISIS. I don't know if any other apps in ISIS produce standalone keywords, I only know of the
If we want to go down this avenue we might as well write new PVL ingestion code for ISIS, so see 1. Time consuming and large overhead/integration time into ISIS.
This is a weak fix but allows users to ingest the
This is something the team started under Stuart, Amy, and I. It was promising but again, a lot of work. This would also remove the need for all of the ingestion We can also work on a mix of these solutions, starting with 3 that is this PR. It provides a more immediate fix and doesn't put us under pressure to bring ISIS PVL reading under compliance immediately. Then begin brain storming on either idea 1 or 2 to bring ISIS into PVL compliance. Or restart work on 4 to reduce the number of Most of these solutions will have some impact on outside users producing W.r.t. "this PR does not fix the OP's bug" I fail to see how. These I agree this is a short term fix, and doesn't address the root cause of the problem but it's something we would need to do anyway if we brought ISIS up to compliance with the PVL spec. I think merging this PR to bring current ISIS |
This might be an easy fix with a small code change. Seems to me that explicitly checking for those keywords in this code section out would permanently fix this problem. I first thought simply commenting out the entire section would do it but I suspect it is part of the parsing algorithm that also returns other non-valued PVL keywords such as END_GROUP and END_OBJECT. Not sure if ISIS has a list of all reserved PVL keywords that are allowed to be valueless, but that might be the place to test for these keywords (which would exclude Auto, Optional and Debug). Nonetheless, it would be a useful exercise to make that change and run your test suite to get an idea of the scope of the impact. Note that you will also find these keywords (Auto, Optional) in some serial number configurations. We absolutely need this capability to generate and distinguish simulated images from other images for control processes. A key part of this process adds a unique label keyword/value that is optional in the serial number configuration. This issue seems to be the most serious PVL problem ISIS has at the moment. This because other packages provide ISIS PVL compliancy work-arounds ( e.g., planetary/pvl and maybe GDAL). If you were to isolate this issue and fix it, it is one more step to make ISIS PVL-compliant, but also shows that maybe some problems can be handled in isolation on a case-by-case basis. For consideration, there are other packages that provide explicit extensions to specs, such as nlohmann::json. JSON specs do not support ordering of JSON keys in an object. However, a separate namespace, nlohmann::ordered_json, provides this functionality and isolates it from the standard. I hope the impact of this fix is not too prominent in ISIS but this code modification would perhaps give information about the scope the problem in ISIS. I find it difficult to get fully behind the ideas suggested as they all seem to be a significant amount of work given apparent scope and available resources. I would particularly discourage |
W.r.t.: "Note that you will also find these keywords (Auto, Optional) in some serial number configurations. We absolutely need this capability to generate and distinguish simulated images from other images for control processes. A key part of this process adds a unique label keyword/value that is optional in the serial number configuration." This is still possible as no code changes are being implemented. We will instead prompt contributors who are adding valueless keywords to translation files to instead make them a boolean I understand the options I provided may not be great but I was asked to provide potential solutions in a previous comment. I agree that many of them are not feasible but doing as you have suggested and making changes to how ISIS reads PVL can be difficult to track and may have unintended side effects. I will look into making a small change to the PVL reader to account for reserved keywords but I won't be spending a ton of time on this. The process for making |
After looking over the API breaking definition provided by ISIS, the |
Description
Related Issue
planetarypy/pvl#108
How Has This Been Validated?
Types of changes
Checklist:
Licensing
This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words: