# FluidDataSet.renamePoint

**URL:** https://discourse.flucoma.org/t/fluiddataset-renamepoint/621
**Category:** Pre-Release Toolbox2 New Ideas
**Created:** [August 3, 2020, 12:35am UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621 "2020-08-03T00:35:03Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![spluta](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/spluta/32/21_2.png) [@spluta](https://discourse.flucoma.org/u/spluta)
#### Post date: [August 3, 2020, 12:35am UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621/1 "2020-08-03T00:35:03Z")

</div>

This is killing me. Let’s say I have a DS with 10 data points, numbered in order. Then I remove dataPoint 6. Now I have points labeled 0, 1, 2, 3, 4, 5, 7, 8, 9. How do I make it so there is no gap with the current tools? I don’t think you can. All you need is .renamePoint, then:

(7…9).do{|i| ds.renamePoint(i, i-1)};

Also, come on, no animated gifs on this site?

---

<div class="post-metadata">

### Author: ![spluta](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/spluta/32/21_2.png) [@spluta](https://discourse.flucoma.org/u/spluta)
#### Post date: [August 3, 2020, 1:10am UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621/2 "2020-08-03T01:10:41Z")

</div>

OK, so here is a functioning solution in the current situation. I think it is too ugly and too difficult.

```auto
~ds.dump({|vals| 
	i=2; //this is the value we have deleted
		if(vals["data"][i.asString]==nil){
			i.postln;
			((i+1)..(vals.size+1)).do{|i2|
				i2.postln;
				vals.postln;
				t = vals["data"][i2.asString];
				vals["data"].removeAt(i2.asString);
				vals["data"].add((i2-1).asString-> t);
		}};
	~ds.load(vals);
})

```

---

<div class="post-metadata">

### Author: ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)
#### Post date: [August 3, 2020, 7:30am UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621/3 "2020-08-03T07:30:02Z")

</div>

I’ll add it to the wishlist

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [August 3, 2020, 11:43am UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621/4 "2020-08-03T11:43:27Z")

</div>

Isn’t the whole point of a dataset with a hash table like structure that it isn’t ordered?

---

<div class="post-metadata">

### Author: ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)
#### Post date: [August 3, 2020, 1:37pm UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621/5 "2020-08-03T13:37:04Z")

</div>

So are you trying to iterate through the dataset? Why would it matter if individual entries are gone.

What I did in C-C-Combine when I load multiple corpora and start getting near the 1million entries point, is start automatically deleting entries below a certain loudness (using some useful shit @a.harker added to `entrymatcher`) and just leave it like that with gaping holes in it. I still query what I need, and get back valid entries, it just skips over “the holes”.

---

<div class="post-metadata">

### Author: ![spluta](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/spluta/32/21_2.png) [@spluta](https://discourse.flucoma.org/u/spluta)
#### Post date: [August 3, 2020, 2:54pm UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621/6 "2020-08-03T14:54:17Z")

</div>

I’m not asking for the DataSet to be ordered. I am asking to be able to rename a point, which is useful well beyond this example.

I totally get the usefulness and limitations of a hash table. If this were just a dictionary, that would be fine. But it is actually a dictionary living beyond a firewall, where getting something simple, like the keys, requires you to dump the entire data set and rustle through the data for the thing you want:

~ds.dump({|vals| vals[“data”].keys.postln})

So, because it is behind a wall, I think some convenience classes for accessing/altering data are necessary.

---

<div class="post-metadata">

### Author: ![spluta](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/spluta/32/21_2.png) [@spluta](https://discourse.flucoma.org/u/spluta)
#### Post date: [August 3, 2020, 3:23pm UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621/7 "2020-08-03T15:23:51Z")

</div>

OK. I’m glad to be wrong. While I still think renaming a point is a valid idea, throwing out the OCD need to keep things tidy within my data structure is much cleaner than always rearranging things.

---

<div class="post-metadata">

### Author: ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)
#### Post date: [August 3, 2020, 4:59pm UTC](https://discourse.flucoma.org/t/fluiddataset-renamepoint/621/8 "2020-08-03T16:59:56Z")

</div>

> [@spluta](#):
>
> But it is actually a dictionary living beyond a firewall, where getting something simple, like the keys, requires you to dump the entire data set and rustle through the data for the thing you want:

Yeah totally. I don’t know the specific implementation or implications are for SC, but having [more ways to get stuff in and out](https://discourse.flucoma.org/t/more-ways-to-get-data-in-and-out-of-fluid-dataset/539) of `fluid.dataset~`s would be fantastic.

At the moment it’s a bit of a strange thing where you can’t get stuff in and out directly, but it’s the central datatype/container for all the TB2 stuff.
