-
Notifications
You must be signed in to change notification settings - Fork 0
Port ThermoML parsing, add data entry types #24
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
Closed
Closed
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
30fd2cf
Draft new ThermoML-like data entry type
mattwthompson 88e5986
Port most of Evaluator's ThermoML parsing
mattwthompson dd1d5cd
Port more code
mattwthompson 060a93d
Port more code
mattwthompson aad037a
Progress towards passing tests
mattwthompson efcb193
Closer to passing tests
mattwthompson cfcd177
More directly port over more Evaluator code
mattwthompson 1eefb8a
Try using new configs?
mattwthompson d12e8c8
Merge remote-tracking branch 'upstream/main' into data-entry-types
mattwthompson fcd4c7b
Refactor ThermoML parsing
mattwthompson 59227d0
Half of single-property parsing tests are passing
mattwthompson 5b4c1b3
Fix dielectric test
mattwthompson 1af1ae7
Fix most properties
mattwthompson ff616c4
Fix test(s), add vapor pressure entry
mattwthompson df8c6f3
Remove debug code / make pylint happy
mattwthompson 5cb30f2
RDKit is required
mattwthompson c2c991b
Remove some dead code
mattwthompson d799d16
Copy Evaluator license
mattwthompson 6e74864
Remove some dead plugin and serialization code
mattwthompson 1496f28
Drop `ThermodynamicState`, `UNDEFINED`
mattwthompson 9783036
Remove most object-oriented complexity
mattwthompson 21874e4
Update dimsim/datasets/thermoml/thermoml.py
mattwthompson 9d40b8a
Merge remote-tracking branch 'upstream/main' into data-entry-types
mattwthompson 54266aa
Use better class-mapping strategy
mattwthompson 59a6029
Revert "Remove some dead plugin and serialization code"
mattwthompson c3915ac
No tags
mattwthompson c417b33
Remove some un-used code
mattwthompson cf26732
Start adding data schema
mattwthompson ee7e926
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6d23b88
Lint
mattwthompson cf82a0a
Remove re-export
mattwthompson c0d1f35
Drop unused type
mattwthompson ad6461c
Add file
mattwthompson c71c7f3
Remove duplicate entry definition
mattwthompson 0939c1e
Fix property phase definition
mattwthompson 74fe411
Move phase into new file for import safety
mattwthompson 4c66618
Fix bad source handling
mattwthompson e85bf69
Merge remote-tracking branch 'upstream/main' into data-entry-types
mattwthompson e774424
Add back "tags" in entries
mattwthompson 7fc69bb
Move properties around
mattwthompson 8df3285
Clean up processing of entry types
mattwthompson 6371280
Do not use subclasses for entry types
mattwthompson 5589fa7
Drop properties, fix type-checking
mattwthompson 578e710
Update Pandas export
mattwthompson 3a847c1
Update Pandas export, promote id
mattwthompson 5f25c6b
Fix type-checking
mattwthompson 49de48e
Test basic Pandas roundtrip
mattwthompson 1e4c0cf
Update dataframe import
mattwthompson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| =============================== OpenFF Evaluator =============================== | ||
|
|
||
| MIT License | ||
|
|
||
| Copyright (c) 2019 Open Force Field Consortium | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import typing | ||
|
|
||
| import datasets | ||
| import pyarrow | ||
|
|
||
| from dimsim.molecule import map_smiles | ||
|
|
||
| DATA_SCHEMA = pyarrow.schema( | ||
| [ | ||
| ("id", pyarrow.string()), | ||
| ("tag", pyarrow.string()), | ||
| ("smiles", pyarrow.list_(pyarrow.string())), | ||
| ("x", pyarrow.list_(pyarrow.float64())), | ||
| ("temperature", pyarrow.float64()), | ||
| ("pressure", pyarrow.float64()), | ||
| ("value", pyarrow.float64()), | ||
| ("std", pyarrow.float64()), | ||
| ("units", pyarrow.string()), | ||
| ("source", pyarrow.string()), | ||
| ] | ||
| ) | ||
|
|
||
|
|
||
| class DataEntry(typing.TypedDict): | ||
| id: str | ||
|
|
||
| tag: str # was previously EntryTag | ||
|
|
||
| smiles: list[str] | ||
|
|
||
| x: list[float] | ||
|
|
||
| temperature: float | ||
|
|
||
| pressure: float | ||
|
|
||
| value: float | ||
|
|
||
| std: float | None | ||
|
|
||
| units: str | ||
|
|
||
| source: str | ||
|
|
||
|
|
||
| def create_dataset(rows: typing.Iterable[DataEntry]) -> datasets.Dataset: | ||
| for row in rows: | ||
| row["smiles"] = [map_smiles(value) for value in row["smiles"]] | ||
|
|
||
| # TODO: validate rows | ||
| table = pyarrow.Table.from_pylist([*rows], schema=DATA_SCHEMA) | ||
|
|
||
| return datasets.Dataset(datasets.table.InMemoryTable(table)) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work? phases is defined as a list of strings, but the defaults are actually given as an IntFlag enum. Could you please add a test?