Skip to content

Fix creating and saving entries with upper case characters#76

Merged
DunklesArchipel merged 3 commits into
echemdb:mainfrom
DunklesArchipel:save_entry_case
Mar 1, 2025
Merged

Fix creating and saving entries with upper case characters#76
DunklesArchipel merged 3 commits into
echemdb:mainfrom
DunklesArchipel:save_entry_case

Conversation

@DunklesArchipel

Copy link
Copy Markdown
Member

Checklist

  • Added an entry in doc/news/.
  • Added a test for this change.
  • Adapted the documentation for this change.

Comment thread unitpackage/entry.py
Comment on lines +867 to +870
.. note::
For a valid frictionless Data Package the basename
MUST be lower-case and contain only alphanumeric
characters along with ``.``, ``_`` or ``-`` characters'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

afaik does frictionless enforce always lowercase. The validity of names is checked upon loading a datapackage by frictionless, so we do not run our test. I added the note here so people don't have to dig deep into the frictionless documentation. If the frictionless policy changes, we might have to rewind the change from this PR.

I think adopting a lowercase solution is the most simple one. Creating, for example, camel case strings is not trivial since the meaning of the string is often unclear. Assume your string is CVmeasurement then that should result in cvMeasurement, which can not be achieved unless you provide an appropriate dictionary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We might want to adopt camel case in our JSON files.

According to the getting started section from frictionless

Arguments conform to the following naming convention:
- for Python interfaces, they are snake_cased, e.g. `missing_values`
- within dictionaries or JSON objects, they are camelCased, e.g. `missingValues`
- in the command line, they use dashes, e.g. `--missing-values`

@DunklesArchipel DunklesArchipel merged commit 4d2ccaa into echemdb:main Mar 1, 2025
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.

2 participants