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

Field capitalization doesnt work as expected #302

Open
2 tasks done
operdeck opened this issue Dec 18, 2024 · 3 comments
Open
2 tasks done

Field capitalization doesnt work as expected #302

operdeck opened this issue Dec 18, 2024 · 3 comments
Labels
bug Something isn't working Python Issues related to the Python tools

Comments

@operdeck
Copy link
Collaborator

pdstools version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pdstools.

Issue description

From Grigoriy:
I noticed that capitalize function does not work as expected. It also capitalizes parts of words in the middle - like GroupvalIDitystartDate. I added that change in the notebook:
for word in capitalize_end_words:
fields_new = [re.sub(word + '\b', word, field, flags=re.I) for field in fields_new]
fields_new = [field[:1].upper() + field[1:] for field in fields_new]

Reproducible example

...

Expected behavior

...

Installed versions

v4

@operdeck operdeck added bug Something isn't working Python Issues related to the Python tools labels Dec 18, 2024
@StijnKas
Copy link
Collaborator

I would argue it does work as expected - the goal was to capitalize subwords - ID is one of those, so it should be capitalized. The short-term solution is just to add words like Validity and Start to the list of words to capitalize... Then we should be good, no?

@operdeck
Copy link
Collaborator Author

operdeck commented Dec 19, 2024 via email

@StijnKas
Copy link
Collaborator

that should be the behavior, yes. if not, we should fix it; let's verify before closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Issues related to the Python tools
Projects
None yet
Development

No branches or pull requests

2 participants