-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
[Bug] Band references need a better name and definition #1868
Comments
Thanks, @wenzeslaus , for launching this. My vote goes to the 'semantic' family as it seems the clearest about what it actually is about, with highest preference for 'semantic label'. |
But this suffers from the same length issue – how to shorten it as having a module parameter "semantic_label" is a bit verbose. Otherwise I also like the "semantic" idea. |
Here is how semantic label would look like in action. Interface of modulesr.support wrapper/i.band replacement:
Low-level r.support call: r.support map=my_landuse semantic_label=CORINE_LULC Same call in Python syntax: gs.run_command("r.support", map="my_landuse", semantic_label="CORINE_LULC") Examples of documentationThese are texts of examples from t.rast.mapcalc and t.rast.list rewritten using semantic label and filtering by semantic label.
Notably, I replaced all "band reference filtering" by "filtered by semantic label" and simplified several places which contained "band reference concept" and "band reference identifier" because "semantic label[s]" didn't seem to need that 3rd word there. An abstract example would then look like: # filter rasters in STRDS by semantic label
t.rast.list input=dataset_name.semantic_label Pseudo-examples of future usageScenario 1 (not so far from the current usage): Creating semantic labels and then using them to access rasters in a imagery group instead specifying the raster name and the user made a typo in the word blue. r.semantic.label map=ortho_r label=red
r.semantic.label map=ortho_g label=green
r.semantic.label map=ortho_b label=bluu # typo here
i.group input=ortho_r,ortho_g,ortho_b group=ortho subgroup=ortho
d.rgb red=ortho.red green=ortho.green red=ortho.blue This may give: Scenario 2 (futuristic): Passing wrong raster as elevation: # works
r.watershed elevation=elevation1 slope=slope
# works
r.semantic.label map=elevation2 label=topographic__elevation
r.watershed elevation=elevation2 ...
# gives a warning
r.semantic.label map=elevation3 label=vegetation__dead_biomass
r.watershed elevation=elevation3 ... This may give: |
I like |
|
On 15/09/21 20:02, Māris Nartišs wrote:
My vote goes to the 'semantic' family as it seems the clearest about
what it actually is about, with highest preference for 'semantic label'.
But this suffers from the same length issue – how to shorten it as
having a module parameter "semantic_label" is a bit verbose.
I don't have issues with long module parameters as you can shorten them
in CLI usage (e.g. semlab=).
So the only ones suffering from long parameter names are those using the
module in Python or other languages where this automatic interpretation
of shortened parameter names does not exist. But this then comes back to
a more general discussion of whether in programming clear variable names
should prime over programmers laziness or not ;-)
|
When a programming language with whitespace significance is in use (Python), variable and function name length is a legitimate concern and not only a preference. Should I prepare a PR replacing "band reference" with "semantic label"? |
While I have been sceptical regarding the need to rename band references (as those of you who were on the call may know), I now see the benefit of renaming. So consider me convinced (again). The concept of semantic labels can use different refernces than known bands and link up to various standards, like e.g.: https://cfconventions.org/Data/cf-standard-names/current/build/cf-standard-name-table.html So in short, I also support the "semantic label" naming. |
In Python, readable names are preferred. Readable may mean different things, but it usually defaults to long ones. Formatting practices like Black take long into account. Function name or parameter name plus value often ends up by itself on a line. |
From my perspective, yes, please. That would be great. I don't have a better name suggestion except for the option of using tag instead of label... and nobody got excited by grassness. |
As this should ideally be done before we branch out GRASS GIS 8, @marisn please go ahead with renaming. |
Let's start with PR changing API ( |
I started to work on a PR (#1928; I have problem finding free time lately). I am a bit stuck as I have no idea what to do with python BandReferenceReader, g.bands, i.bands. Suggestions welcome. |
One of problems with BandReferenceReader, g.bands and i.band is that they where skipped in #1796 (along with updating documentation!) and thus still mandate |
Rename band references to semantic labels (fixes #1868)
Rename band references to semantic labels (fixes #1868)
According to a proposal by PSC: https://trac.osgeo.org/grass/wiki/PSC/Minutes/PSC_Meeting_20211112 Related to #1868 and #1928
According to a proposal by PSC: https://trac.osgeo.org/grass/wiki/PSC/Minutes/PSC_Meeting_20211112 Related to #1868 and #1928
Rename band references to semantic labels (fixes OSGeo#1868)
…#1983) According to a proposal by PSC: https://trac.osgeo.org/grass/wiki/PSC/Minutes/PSC_Meeting_20211112 Related to OSGeo#1868 and OSGeo#1928
Rename band references to semantic labels (fixes OSGeo#1868)
…#1983) According to a proposal by PSC: https://trac.osgeo.org/grass/wiki/PSC/Minutes/PSC_Meeting_20211112 Related to OSGeo#1868 and OSGeo#1928
The issue
The term band reference was introduced with #63. There, perhaps, the word reference was referring to the fact that the text is referring to the band description stored in the file g.bands gives access to. However, now an arbitrary band reference can be stored for any raster map, i.e., it is more general than just bands from a predefined (or possibly in the future, registered) list of bands associated with particular sensors.
The band references can now be used (optionally assuming #1866) to label any rasters (raster maps or bands) in an imagery group so that signatures are associated with given set of bands rather than just a fixed set of raster data.
Going even further, the usage does not have to limited to image processing. For example, in modeling, standardized names such as
topographic__elevation
andsea_surface_air__temperature
are used to describe inputs and outputs of models (see Landlab Standard Name Definitions and CSDMS Standard Names).Overall, band references quickly outgrew their original definition and there is a potential to have good name suggesting the potential use. At the same time, there is a potential for ending up with a cryptic term which is difficult to explain and difficult to link to its application.
The issues with the current name are:
Since the current system is not part of any release yet, now is the time to get it right.
Naming options
Expected resolution
Additional context
We discussed this during the last call, but decided to open this as an issue to discuss this in written form and asynchronously.
The text was updated successfully, but these errors were encountered: