Migrate from legacy local dods.dap to standard opendap.dap package (#79) - #529
Open
ChrisJohnNOAA wants to merge 5 commits into
Open
Migrate from legacy local dods.dap to standard opendap.dap package (#79)#529ChrisJohnNOAA wants to merge 5 commits into
ChrisJohnNOAA wants to merge 5 commits into
Conversation
* Migrate from legacy local dods.dap classes to modern standard opendap.dap package - Remove the legacy locally-bundled `dods.dap` package source code from `WEB-INF/classes/dods`. - Change `edu.ucar:opendap` dependency scope from `runtime` to `compile` in `pom.xml`. - Migrate all imports and class references from `dods.dap.*` to `opendap.dap.*`. - Use standard `DConnect2` instead of the legacy `DConnect` class. - Resolve API discrepancies: * Adjust `new DConnect2(...)` invocations to use standard constructors. * Map `getName()` calls on opendap nodes and dimensions to `getClearName()`. * Use standard `java.util.Enumeration` for standard `getVariables()`, `getNames()`, and similar methods. * Use `getValuesIterator()` and `getContainerN()` on `Attribute` to avoid `NoSuchAttributeException`. * Remove custom/non-standard `DBoolean` type references. - All unit tests pass successfully. * Clean up unused DAP_TO_NC task * Additional cleanup of now unused functions
* Refactor EDDGridFromDap and EDDGridFromErddap to use NetCDF-Java APIs - Replaced low-level opendap.dap classes with high-level NetCDF-Java APIs (NetcdfDatasets, Variable, Range, Section) in constructors, metadata scraping (generateDatasetsXml), lowUpdate, and getSourceData. - Bypassed DAS/DDS serialization inside quick-restart Nc3 files, instead caching dimension sizes, structures, types, and variable/global attributes directly prefixed (e.g. global:, axis:, vardata:) using NcHelper.writeAttributesToNc3. - Utilized ucar.ma2.Section slicing inside getSourceData to fetch data variables and subset axis coordinate slices in-place. - Created getSectionFromConstraints helper on NcHelper.java to DRY and clean up the getSourceData section generation.
* Refactor Opendap.java to use NetCDF Dataset API Replace legacy DConnect2 and opendap.dap type usage in getGridInfo and makeGrid methods with high-level NetCDF dataset and variable APIs. Update callers in OpendapTest.java and OpendapTests.java to align. Add offline local file test to OpendapTests.java.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
dods.dappackage source code fromWEB-INF/classes/dods.edu.ucar:opendapdependency scope fromruntimetocompileinpom.xml.dods.dap.*toopendap.dap.*.DConnect2instead of the legacyDConnectclass.new DConnect2(...)invocations to use standard constructors.getName()calls on opendap nodes and dimensions togetClearName().java.util.Enumerationfor standardgetVariables(),getNames(), and similar methods.getValuesIterator()andgetContainerN()onAttributeto avoidNoSuchAttributeException.DBooleantype references.Note: a lot of the changed lines are indentation from using DConnect in a try-with-resources.
I'm working on additional changes to migrate to the higher level NetCDF datasets api. This future work should simplify the code, make it more consistent with the classes already using other NetCDF apis, and give us additional benefits (like DAP4 support).
Fixes: Lots of ErrorProne warnings and reduces extreme legacy code that we need to maintain.
Type of change
Please delete options that are not relevant.
Checklist before requesting a review