Skip to content
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

Script.py naming convention makes search difficult #894

Open
sillkjc opened this issue May 6, 2024 · 1 comment
Open

Script.py naming convention makes search difficult #894

sillkjc opened this issue May 6, 2024 · 1 comment

Comments

@sillkjc
Copy link

sillkjc commented May 6, 2024

Hi,
A minor issue but its a little bit of a QOL pet peeve. Since states scripts are all called script.py it becomes difficult to see the context of a search result in most IDE's. You have to resort to the path to determine what state the script belongs to. In some cases, as shown below, this is impossible to see without clicking on each one individually. You should be able to get some context from the filename, but instead we need to use the file location:
image

Git commit window in Pycharm:
image

Searching by file name is also difficult (and will get worse when we produce hundreds of states:
image

Would it be possible to include an option to name the script uniquely based on the state name?
Many thanks

@JohannesErnst
Copy link
Collaborator

JohannesErnst commented May 6, 2024

Hey @sillkjc,

I totally understand the bother. When using VSCode the whole path is usually showing which makes it easier to see or we mainly develop using the RAFCON GUI anyways.

While I think changing the name would make sense from a user perspective, I know that this would be quite some effort to actually implement. We would first need additional statements to check the name and also some functionality that keeps the naming of the path and script consistent. Especially when renaming (which we do quite often) this could quickly become messy if not properly implemented. Currently, we are also planning to reduce the memory consumption which runs a little opposite to the idea of more individualism in the naming convention in general...
Because of this I don't think we will have the resources to tackle this anytime soon. However, I encourage you to contribute to the RAFCON project if you have time!

I will definitely leave this open for now, maybe we will see an urgent need for this change in the future as well.

For now I can only recommend some workaround: Maybe consider including a header to all your scripts which holds the state name, and some author and maybe description. This is also kinda ugly as this information should go into the dedicated description field of a state and also only solves half of your problem. But maybe worth trying out...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants