Remove ratings from downloaded SGFs

I use the setting to hide all rankings/ratings from view and often play solely in zen mode. However, sometimes I would like to review my games with an AI. Unfortunately the SGFs are still embedded with player ratings with downloading them, even with the hide setting enabled.

Would it be possible to remove the player ratings from the downloaded SGFs for players that use this setting? I saw this was requested in 2021, but the item seemed to be closed without meaningful response.

edit: It also looks like ‘Settings’ follow the browser, rather than the account? Changing settings on one account seems to cause them to be reflected in the other. This caused me to inadvertently see my rank on the account where I did not wish to. Why are the Settings managed this way, and can that be altered as well?

5 Likes

open the SGF file with notepad, and edit the rank info. then save the file.
you just need less than 10 seconds.

1 Like

It takes much longer to do it with closed eyes

8 Likes

but still much faster than complaining about the Settings

1 Like

This could mean that this feature request has little or no priority.

So @kick_your_उ_withᅤ’s workaround seems like a constructive workaround.

I’m not sure how constructive it is since OP’s whole point is to avoid seeing their rank. That “workaround” doesn’t solve anything.

1 Like

Something is better than nothing.
Apart from @kick_your_उ_withᅤ no other solutions have been offered.

Remove the rankings of some games, leave them alone for a while and then analyse them (when you forgot the rank you removed).

More suggestions:

You could write a script to remove the rank from the SGF without you having to look at it. It can be done in one line with a regular expression.

You could use an SGF viewer that does not display player ranks or has an option to hide them, like OGS does. I have no specific suggestion for such a program unfortunately. Sabaki does not seem to have it at first glance. You could also try a feature request with Sabaki to add the option.

8 Likes

Sure, but my point is that this is nothing.

This is nothing as well since you see your rank when you remove it, which is the whole point.

@Animiral’s suggestions are something, however.

1 Like

I don’t understand the resistance from people here that aren’t going to be the ones creating the code update. All I expect from my very reasonable request is that a backlog item is created and that it is eventually is incorporated into the codebase.

This change makes absolute functional sense from the perspective of a “hide my rank” setting, and I personally consider its omission to be a defect.

Given that I have a background as a software engineer, yes, as someone mentioned, I could write a script for this myself. However, that is an unproductive and unrealistic expectation for someone seeking to improve a given software product.

My request stands; and it is of value. It is a defect of the current “hide my rank” setting. I would like for it to be created as a backlog development item. I understand if it is given a lower priority.

Also, settings in general should follow the account, not the browser. I can create a separate item for that, if desired.

3 Likes

I sincerely hope that someone will write that script for you.
But don’t hold your breath waiting for it.

Maybe you can interest @GreenAsJade into this.

Resistance to change is just human nature and I am afraid it is only going to get stronger once you actually get an answer from the people who would update the code. :wink:

It remains to be established that your request is actually an improvement. One might argue that hiding ranks is a presentation issue and that deleting data from the document is the wrong way to achieve what you want. In terms of presentation, OGS already implements it.

We are trying to help you solve your challenge without that uphill battle. Especially as developers, we are inclined to apply our hammer to every nail. But as you well know, the best code is no code and the easiest way to get a solution is to eliminate the need for it. :slight_smile:

2 Likes

I sincerely hope that someone will write that script for you.

I’m becoming doubtful that people are even reading this thread, at this point. To be clear, I’m not asking for someone to “write me a script”. I could do that myself. I’m asking for a defect in the current codebase to be eliminated.

It remains to be established that your request is actually an improvement. One might argue that hiding ranks is a presentation issue and that deleting data from the document is the wrong way to achieve what you want.

The setting is to hide one’s rank/rating throughout the user experience. It makes no sense to then include that rank/rating in the SGF for any user that does not want to see it. It isn’t being “deleted from the document” – it shouldn’t be in the document in the first place. It can be included in the SGF for users that do not have this setting enabled. That is the point of a setting.

I was not aware that bugfixes and feature requests on the OGS Development forum invited a public peanut gallery. Am I not requesting this in the correct location? Is there a more formal place for me to file my defect such that it gets visibility from the actual people responsible for coding this project?

You are not a very nice person, aren’t you?
Putting down people who try to help you, is rude and ungrateful.

1 Like

Your ideas are good.
But, there are also MANY good ideas from different other people. It doesn’t matter how easy to implement each of them. There are too many of them. So only ideas that admins or developers think are VERY important, would be implemented fast. Other ideas, unfortunately, will be implemented slowly., unless you become one of those developers.

3 Likes

Thank you for one of the first thoughtful responses thus far. I am very aware of how a typical software development is prioritized and handled, as I have worked with every step of the process throughout a decades-long career.

As long as my idea ends up on a prioritized list of bugs to fix and features to implement, I will be happy. Do we have visibility into such a list?

And yes, I may investigate the repository and work on it myself, at that point, if necessary.

Aren’t online forums fun?

Here is the repository: GitHub - online-go/online-go.com: Source code for the Online-Go.com web interface

Here is a quick and dirty script to remove ranks from your downloaded files:

import glob
import re

def removeRank(filename):
    with open(filename, 'r+') as file:
        regex = '[BW]R\\[.+\\]\n'
        replaced = re.sub(regex, '', file.read())
        file.seek(0)
        file.write(replaced)
        file.truncate()

def main():
    for filename in glob.glob('*.sgf'):
        print(f'Removing ranks from {filename}')
        removeRank(filename)

if __name__ == '__main__':
    main()

To use it, put all your sgf files in one directory along with a file named removerank.py in which you have pasted the above code, then run python removerank.py. Note that this will affect every sgf in the current directory (this software is provided as is, I can take no liability, etc). Hope it helps!

Edit: I am aware that OP doesn’t want a script. However, hopefully this will help others with similar concerns and tide them over until this feature is addressed on the site (if/when that happens). As others have mentioned, it is such a minor request affecting very few users that it is unlikely to happen soon unless a motivated individual implements it themselves. This is not to say it couldn’t be useful, just to give perspective knowing how swamped the project is with requests and larger bugs.

4 Likes

It certainly helps, and I appreciate you putting in the effort. I may utilize this in the meantime, although I still maintain that the best solution is to incorporate the change into the product itself.

I’ll try to look at the repository when I have some time. I assume this means there is no Jira or other system being utilized to record and prioritize various requests?

1 Like

Issues are tracked here as far as I know: Issues · online-go/online-go.com · GitHub. There may be another internal tracker with more prioritization, but you’d have to ask anoek or GreenAsJade.

One issue you may encounter looking at implementing this yourself is that, as far as I remember, sgf exports are handled on the backend which is not open source.

2 Likes

I would have anticipated it being a backend function, yes. Without looking at it at all, my thought would be that the client calls the SGF URL with a “?hideRank=true/false” parameter and the backend simply includes it or not based on that. Given that settings are (very unfortunately) following the browser instead of the account, the setting probably even already exists in a cookie that the backend can utilize as-is. But I would be hesitant to implement more couplings to that if we ever wanted to be rid of cookie-based settings.

As for the backend not being open source – oof. Deadend, I suppose! I’ll still take a peek at it to be sure.

2 Likes