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

Check up on restrictions to signac view #926

Merged
merged 9 commits into from
Jul 19, 2023
Merged

Conversation

cbkerr
Copy link
Member

@cbkerr cbkerr commented May 29, 2023

Description

I had a space in my state point and was surprised that I couldn't make a signac view. This fix worked for me on mac but I'll run the tests on Windows and Linux through GitHub.

Motivation and Context

The PR that created this restriction was initially a fix involving path separation characters but there was no reason given for also excluding spaces and asterisks. I was able to create views in tests with these characters on mac.

I tested this locally with my project that had spaces in the state point after this change, and it worked.

There are other characters we might want to exclude as well, like ?, [], {}. These characters might be annoying to escape on the terminal, but a strong use of view is to browse in a file browser.

Perhaps we can emit a warning about special characters being used?

I think if the tests pass in creating views, then we should be good to create views with spaces and asterisks in the state point.

Checklist:

@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Merging #926 (ec57024) into main (d6b5aa6) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #926      +/-   ##
==========================================
- Coverage   85.68%   85.68%   -0.01%     
==========================================
  Files          20       20              
  Lines        3458     3457       -1     
  Branches      758      758              
==========================================
- Hits         2963     2962       -1     
  Misses        335      335              
  Partials      160      160              
Impacted Files Coverage Δ
signac/linked_view.py 89.51% <100.00%> (-0.09%) ⬇️

@cbkerr cbkerr marked this pull request as ready for review May 29, 2023 16:12
@cbkerr cbkerr requested review from a team as code owners May 29, 2023 16:12
@cbkerr cbkerr requested review from tcmoore3, shihkual and b-butler and removed request for a team May 29, 2023 16:12
Copy link
Member

@b-butler b-butler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of quick changes.

tests/test_project.py Outdated Show resolved Hide resolved
tests/test_project.py Outdated Show resolved Hide resolved
@@ -64,7 +64,7 @@ def create_linked_view(project, prefix=None, job_ids=None, path=None):
key_list = [k for job in jobs for k in job.statepoint().keys()]
value_list = [v for job in jobs for v in job.statepoint().values()]
item_list = key_list + value_list
bad_chars = [os.sep, " ", "*"]
bad_chars = [os.sep]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a list any more. It should also be a quicker check to use ==.

@vyasr
Copy link
Contributor

vyasr commented Jun 3, 2023

Spaces were probably excluded because they don't work on older filesystems, and I'm guessing that one of the supercomputers we originally cared about (maybe the original Stampede, not even Stampede2? Not sure) was an example. I'm fine with removing the restriction and leaving the onus on the user to recognize why a view fails if they have such a filesystem. If we wanted, we could add a warning if spaces are detected saying that it may not work and is filesystem-dependent.

@bdice
Copy link
Member

bdice commented Jul 12, 2023

@cbkerr @b-butler Can you push this through?

@b-butler b-butler merged commit 6b8e1a3 into main Jul 19, 2023
17 checks passed
@b-butler b-butler deleted the fix/linked-view-restrictions branch July 19, 2023 17:42
@cbkerr cbkerr added this to the v2.2.0 milestone Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants