-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Dataset#category #406
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
Open
tristan-f-r
wants to merge
20
commits into
Reed-CompBio:main
Choose a base branch
from
tristan-f-r:categories
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f1cbe33
fix: check if edge weights are between 0 and 1
tristan-f-r f89e733
fix: better err message on invalid ranges
tristan-f-r 8e4016b
test: dataset
tristan-f-r f275e57
test: one for some normal dataset
tristan-f-r 04632f1
style: fmt
tristan-f-r e5ad211
docs: on datasetdict
tristan-f-r e9ad2fd
chore: update naming for empty ds
tristan-f-r 54be58e
test: empty sources, targets, node-prizes, or network
tristan-f-r a6788a3
test: empty headers
tristan-f-r 79f1682
style: fmt
tristan-f-r d0fc7e2
refactor: drop unused dataset edge weight restriction
tristan-f-r e778dbb
Merge branch 'umain' into weight-range
tristan-f-r 482be1a
Merge branch 'main' into weight-range
tristan-f-r ae9d361
docs: better DatasetDict docstring
tristan-f-r e807ad4
Merge branch 'main' into weight-range
tristan-f-r 78c9565
Merge branch 'main' into weight-range
tristan-f-r 43d746b
feat: Dataset#category
tristan-f-r df9c295
chore: make Datset#category optional in schema
tristan-f-r edb25c4
feat: store dataset categories
tristan-f-r 965f87c
Update spras/config/schema.py
tristan-f-r 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
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,2 @@ | ||
| A B 1 U | ||
| B C 0.5 U |
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 @@ | ||
| NODEID prize active dummy |
Empty file.
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,2 @@ | ||
| A B 1 U | ||
| B C 0.5 U |
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 @@ | ||
| NODEID prize active dummy |
Empty file.
Empty file.
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,3 @@ | ||
| NODEID prize active dummy | ||
| A 2 true true | ||
| C 5.7 true |
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 @@ | ||
| A |
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 @@ | ||
| B |
Empty file.
Empty file.
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,2 @@ | ||
| A B 1 U | ||
| B C 0.5 U |
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,3 @@ | ||
| NODEID prize active dummy | ||
| A 2 true true | ||
| C 5.7 true |
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 @@ | ||
| A |
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 @@ | ||
| C |
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,60 @@ | ||
| from pathlib import Path | ||
|
|
||
| import pandas | ||
| import pytest | ||
|
|
||
| from spras.dataset import Dataset | ||
|
|
||
| FIXTURES_PATH = Path('test', 'dataset', 'fixtures') | ||
|
|
||
| class TestDataset: | ||
| def test_not_allow_no_cols(self): | ||
| with pytest.raises(pandas.errors.EmptyDataError): | ||
| Dataset({ | ||
| 'label': 'empty', | ||
| 'edge_files': ['network.txt'], | ||
| 'node_files': ['sources.txt', 'node-prizes.txt'], | ||
| 'other_files': [], | ||
| 'data_dir': FIXTURES_PATH / 'empty' | ||
| }) | ||
|
|
||
| def test_not_allow_no_cols_headers(self): | ||
| with pytest.raises(pandas.errors.EmptyDataError): | ||
| Dataset({ | ||
| 'label': 'empty-headers', | ||
| 'edge_files': ['network.txt'], | ||
| 'node_files': ['sources.txt', 'node-prizes.txt'], | ||
| 'other_files': [], | ||
| 'data_dir': FIXTURES_PATH / 'empty-headers' | ||
| }) | ||
|
|
||
| def test_dataless(self): | ||
| with pytest.raises(pandas.errors.EmptyDataError): | ||
| Dataset({ | ||
| 'label': 'dataless', | ||
| 'edge_files': ['network.txt'], | ||
| 'node_files': ['sources.txt', 'node-prizes.txt'], | ||
| 'other_files': [], | ||
| 'data_dir': FIXTURES_PATH / 'dataless' | ||
| }) | ||
|
|
||
| def test_empty_network(self): | ||
| with pytest.raises(pandas.errors.EmptyDataError): | ||
| Dataset({ | ||
| 'label': 'empty-network', | ||
| 'edge_files': ['network.txt'], | ||
| 'node_files': ['sources.txt', 'node-prizes.txt'], | ||
| 'other_files': [], | ||
| 'data_dir': FIXTURES_PATH / 'empty-network' | ||
| }) | ||
|
|
||
| def test_standard(self): | ||
| dataset = Dataset({ | ||
| 'label': 'empty', | ||
| 'edge_files': ['network.txt'], | ||
| 'node_files': ['node-prizes.txt', 'sources.txt', 'targets.txt'], | ||
| 'other_files': [], | ||
| 'data_dir': FIXTURES_PATH / 'standard' | ||
| }) | ||
|
|
||
| assert len(dataset.get_interactome()) == 2 |
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
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.
Uh oh!
There was an error while loading. Please reload this page.