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

Added exception for any symbol apart from . in names #529

Merged
merged 4 commits into from
Jan 11, 2021
Merged

Conversation

iparask
Copy link
Contributor

@iparask iparask commented Jan 4, 2021

This PR fixes #392.

It raises an exception if any symbol other than '.' is used in the name of a task, stage, or pipeline.

@iparask iparask requested review from lee212 and mturilli January 4, 2021 17:35
@iparask iparask added this to the Jan 2021 Release milestone Jan 4, 2021
@codecov
Copy link

codecov bot commented Jan 4, 2021

Codecov Report

Merging #529 (24d5f13) into devel (7270683) will increase coverage by 0.28%.
The diff coverage is 74.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #529      +/-   ##
==========================================
+ Coverage   61.52%   61.80%   +0.28%     
==========================================
  Files          20       21       +1     
  Lines        2277     2299      +22     
==========================================
+ Hits         1401     1421      +20     
- Misses        876      878       +2     
Impacted Files Coverage Δ
src/radical/entk/pipeline.py 90.14% <70.00%> (-0.91%) ⬇️
src/radical/entk/stage.py 91.91% <73.33%> (+0.50%) ⬆️
src/radical/entk/constants.py 100.00% <100.00%> (ø)
src/radical/entk/task.py 76.97% <100.00%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7270683...24d5f13. Read the comment docs.

@iparask
Copy link
Contributor Author

iparask commented Jan 4, 2021

@iparask: What is the performance overhead?

@iparask
Copy link
Contributor Author

iparask commented Jan 5, 2021

I measured the added overhead and the times in seconds are in the following table. Each row shows the number of Tasks. Column devel shows the time to create tasks as it is in devel right now and patch the overhead the patch will introduce for checking the names for all characters.

# of Tasks devel patch
100 0.001217 0.001459
1000 0.010253 0.012463
10000 0.102031 0.126590
100000 1.023988 1.226712
1000000 10.166029 12.207186

Copy link
Contributor

@mturilli mturilli left a comment

Choose a reason for hiding this comment

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

Left some comments.

actual_value=d['name'],
expected_value="Valid object names can " +
"contains letters, numbers and '.'. Any "
"other character is not allowed")
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth to store these messages in a dedicated data structure? See that you repeated the same message twice, and now we have to fix the same error in both instances of the same message. More in general, should we template exceptions? Repeating attribute and other parameters all the time might be undesirable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created a constants file to keep constants in general. I placed the message there. Some exceptions are already templated, but I am not a fan because it confuses me a bit. I can do it if you think it is important.

Copy link
Member

Choose a reason for hiding this comment

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

This should only be done for messages we use a lot IMHO.

Copy link
Contributor

Choose a reason for hiding this comment

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

This message is used ~8 times and each instance had the same typo. Happy for you to have the last word.

Copy link
Contributor

Choose a reason for hiding this comment

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

@iparask, about the templating, happy to follow your preference as you are the main developer of EnTK. I would probably stress the need of consistency so that we do not end up with a mix of (non)templated exceptions?

@iparask iparask merged commit c6e5d81 into devel Jan 11, 2021
@iparask iparask deleted the fix/issue_392 branch January 11, 2021 15:17
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.

_ special character is not allowed in names of Pipeline, Stage, and Task; failing data sharing
3 participants