Opened 4 years ago

Closed 20 months ago

#2752 closed enhancement (wontfix)

t.remove: add dual-step removal as in g.remove

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.4.1
Component: Temporal Version: svn-trunk
Keywords: t.remove Cc:
CPU: All Platform: All

Description

At time t.remove removes data without warning and force flag.

There are two disadvantages:

  • the user being familiar with g.remove's behaviour will be surprised
  • there is no chance to catch the lack of using -rf (of course a user error), leading to the situation:
GRASS 7.1.svn (eu_laea):~ > t.remove lst_aggreg_modis_week@modis_lst_reconstructed_europe_daily
Note: registered maps themselves have not been removed, only the strds

... user's thought in this moment: "Heck, now the strds is gone but I forgot to specify -rf to also get rid of the related raster maps and no easy way to do that now... nor how to figure out their map names!"

I refer to situations where thousands of maps are stored in a mapset with similar names which is common in time series processing.

Solution:

At time it is a bit confusing since -f would be the best flag name (as it is used in g.remove). I don't think that it would be a problem to even redefine the meaning of -f in G7 since t.remove is still rather new. Hence:

  • change meaning of -f to "force removal" (without -f only show what would be done, yet don't remove). Advertise also -rf in the message.
  • -d Remove all registered maps from the temporal and also from the spatial database (required for actual deletion of files)

Attachments (1)

tremove.diff (1.2 KB) - added by lucadelu 4 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 4 years ago by neteler

Milestone: 7.0.27.0.3

Ticket retargeted after milestone closed

comment:2 Changed 4 years ago by neteler

Milestone: 7.0.3

Ticket retargeted after milestone closed

comment:3 Changed 4 years ago by neteler

Milestone: 7.0.4

Ticket retargeted after 7.0.3 milestone closed

comment:4 Changed 4 years ago by lucadelu

Hi, please test this diff to see if it is following the requested behaviour.

Other changes are requested in the testsuite of several t.* modules

Changed 4 years ago by lucadelu

Attachment: tremove.diff added

comment:5 Changed 4 years ago by neteler

The question is how to deal with the flag character to be used...

comment:6 in reply to:  5 Changed 4 years ago by lucadelu

Replying to neteler:

The question is how to deal with the flag character to be used...

Maybe I could apply this changes in trunk and not backport after we could release these in the next stable major release

comment:7 Changed 4 years ago by martinl

Milestone: 7.0.47.0.5

comment:8 Changed 3 years ago by martinl

Ping.

comment:9 Changed 3 years ago by martinl

Milestone: 7.0.57.3.0

comment:10 Changed 3 years ago by martinl

Milestone: 7.3.07.4.0

Milestone renamed

comment:11 Changed 3 years ago by neteler

Why not have it in 7.2?

comment:12 Changed 22 months ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:13 Changed 22 months ago by martinl

What is status of this issue?

comment:14 in reply to:  13 ; Changed 22 months ago by veroandreo

Replying to martinl:

What is status of this issue?

The behavior described in the ticket is still the current behavior:

  • no flag set: removes the strds directly (no warning) -->> I think it would make sense to have a WARNING as in G7:g.remove and a flag to force the removal of strds only
  • if only -r flag is set, the user gets: ERROR: The recursive flag works only in conjunction with the force flag: use -rf -->> IMHO, it would be consistent with G7:g.remove to get the list of maps that will be removed plus a WARNING with advice to use both flags (-rf) to actually remove strds and maps, otherwise what is the point of having a flag (-r) that cannot be used alone?

comment:15 in reply to:  14 ; Changed 22 months ago by lucadelu

Replying to veroandreo:

Replying to martinl:

What is status of this issue?

The behavior described in the ticket is still the current behavior:

  • no flag set: removes the strds directly (no warning) -->> I think it would make sense to have a WARNING as in G7:g.remove and a flag to force the removal of strds only
  • if only -r flag is set, the user gets: ERROR: The recursive flag works only in conjunction with the force flag: use -rf -->> IMHO, it would be consistent with G7:g.remove to get the list of maps that will be removed plus a WARNING with advice to use both flags (-rf) to actually remove strds and maps, otherwise what is the point of having a flag (-r) that cannot be used alone?

I think this is a behavior change and it could affect some add-ons since -f should be used like in g.remove so to really remove. I think this should released in next major release. I would like to have this behavior:

  • without flag it show the warning
  • -r to show the maps connected with the temporal dataset
  • -f remove temporal dataset (with -r remove maps from temporal framework)
  • -d to delete maps from mapset

What do you think?

comment:16 in reply to:  15 Changed 22 months ago by veroandreo

Replying to lucadelu:

I think this is a behavior change and it could affect some add-ons since -f should be used like in g.remove so to really remove. I think this should released in next major release. I would like to have this behavior:

  • without flag it show the warning
  • -r to show the maps connected with the temporal dataset
  • -f remove temporal dataset (with -r remove maps from temporal framework)
  • -d to delete maps from mapset

What do you think?

Sorry for my ignorance here, but is a new flag needed?

I was thinking of:

  • no flag: shows the warning that to remove strds -f should be used
  • only -f: removes the strds, and warns that -rf should be used to remove the maps
  • only -r: shows maps in the strds that will be removed and warns that -r and -f should be used to remove the maps
  • -rf to remove strds and maps (as now)

comment:17 Changed 20 months ago by veroandreo

Resolution: wontfix
Status: newclosed

Since this would imply a change in the behaviour of the flags that is only possible in major releases, we close this ticket as won't fix. See #3362 for such a request for GRASS 8 :)

Note: See TracTickets for help on using tickets.