Ouranosinc / pavics-sdi

Power Analytics and Visualization for Climate Science - Spatial Data Infrastructure
https://pavics-sdi.readthedocs.io
6 stars 2 forks source link

More informative directory names and notebook filenames in JupyterLab #178

Closed huard closed 3 years ago

huard commented 4 years ago

In tutorial notebooks, I suggest we rename:

Edit: Also, could we shorten the path to the raven notebooks ? Clicking on Hydrological Modeling and analysis would open directly the notebooks folder. I understand we might need to remove the dependency to files stored locally to do this, but it's worth it.

huard commented 4 years ago

cc: @tlogan2000

tlvu commented 4 years ago

Would "Check_CF-Compliance_and_inspection_server-side" be okay to avoid having spaces in filenames.

huard commented 4 years ago

Is there a strong indication against spaces?

tlvu commented 4 years ago

Spaces usually cause weird errors when the underlying code is not 100% solid. For example when you tab completion on the linux command-line, filename with space won't autocomplete properly. Source code file almost always don't have spaces.

From experiences, I usually prefer to stay away from spaces to avoid having to waste time to debug weird errors.

If there is a strong usecase, the benefits can outweigh the annoyances. Is Jupyter user really turn off by filenames not using spaces? I think most Jupyter users are also coders so they are used to see filenames and folder names not containing spaces.

Zeitsperre commented 4 years ago

Which looks nicer? pytest --nbval ESGF_Analytic_Services.ipynb or pytest --nbval ESGF\ Analytic\ Services.ipynb / pytest --nbval "ESGF Analytic Services.ipynb"?

tlogan2000 commented 4 years ago

I could live with underscores as long as capitalization remains (not mentioned in the discussion but just saying) e.g. "ESGF_Analytic_Services" seems not too bad but I tend not to like "esgf_analytic_services" when I know that really ESGF should be capitalized...

However, am just wondering how the deployment works and if the spaces would really cause any issues? From what I understand there is no 'tutorial-notebooks' repo that is tested then copied directly into the user workspaces right? We pull various notebook from birdhouse/pavics repos here and there on github ... So any testing of notebooks occurs before we organize them in the user space right? Once the user is in the jupyter environment they simply navigate to the tutorial and run the notebook of interest and it runs from the cwd (I think)

huard commented 4 years ago

@tlvu I agree and I always avoid spaces as well. In this situation, I think we can make the case that using spaces will improve readability for users who might not all be hard-core programmers.

tlogan2000 commented 4 years ago

Other possibility would to have git repos with underscores but replace '_' with ' ' when creating user workspaces? I agree with @huard the readability could be a nice addition. Some recent pavics users that I have made accounts for aren't python pros but have seen the potential are willing to give it a shot... Better organization etc will just reduce the amount of support / questions that come after the fact I think

tlvu commented 4 years ago

I could live with underscores as long as capitalization remains

Of course, no issue with capitalization.

However, am just wondering how the deployment works and if the spaces would really cause any issues?

Each time I had to support spaces in filename or directory name, some issue somewhere will crop up. Just don't know how deep in the stack the root cause and the fix will be. I got bitten enough in the past that I prefer to not repeat history again.

From what I understand there is no 'tutorial-notebooks' repo that is tested then copied directly into the user workspaces right? We pull various notebook from birdhouse/pavics repos here and there on github ... So any testing of notebooks occurs before we organize them in the user space right? Once the user is in the jupyter environment they simply navigate to the tutorial and run the notebook of interest and it runs from the cwd (I think)

Exact, there is no central 'tutorial-notebooks' repo. It's an aggregation from notebooks from various sources. However, we do have the capability to test the whole "bundle", that's what our Jenkins is doing. It builds the exact same "bundle" and test them all ... well for those we know pass, which is only notebooks in pavics-sdi and finch repo. The rest (raven, esgf-compute-api) are part of the "bundle" but are not tested because they never pass.

using spaces will improve readability for users who might not all be hard-core programmers

But these users are at least scientists? They are unable to look past the space/underscore issue and realize the potential of the offering? I understand artists and/or writers will find underscore to replace space weird but anyone with some scientific background, really? Are we targeting users without any science background at all? Then how would they make good use of the tool without science background?

Other possibility would to have git repos with underscores but replace '_' with ' ' when creating user workspaces?

Yeah that could be one way out to not commit filename with spaces in source control but still have filename with space when we deploy.

Some recent pavics users that I have made accounts for aren't python pros but have seen the potential are willing to give it a shot...

And by the time we eventually attract python pros, we'll look a little weird with all those spaces.

Better organization etc will just reduce the amount of support / questions that come after the fact

Agree with this one. But ideally should not incur more maintenance effort on our part either.

So after reading all of this, if you guys will want spaces, I'd take Travis proposal to replace underscore to space only at deployment time. No space everywhere else to limit the "attack surface" of space bugs.

Or even better have an explicit "actual name" to "friendly name" mapping for each file so we can also have underscore in the "friendly name" if need be.

huard commented 4 years ago

We'll need a mapping for the directories anyway right ? So using a mapping for everything sounds good to me.

tlogan2000 commented 4 years ago

Just about to reply when David more less said what I thought...

huard commented 3 years ago

Raven notebooks have been renamed.