Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow reading beliefs from xlsx files, and from data files with multi…
…ple headers (#103) * Allow reading beliefs from xlsx files, and from data files with multiple headers * Allow creating new sources and looking up existing sources * Refactor get_or_create_source * Optional flush * Take into account that current_user can be of LocalProxy type, and use get_current_object to get the User object * Improve docstring Co-authored-by: Nicolas Höning <iam@nicolashoening.de> Co-authored-by: F.N. Claessen <felix@seita.nl> Co-authored-by: Nicolas Höning <iam@nicolashoening.de>
- Loading branch information
1 parent
8ed869d
commit 04e1076
Showing
10 changed files
with
170 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
39 changes: 39 additions & 0 deletions
39
...s/data/migrations/versions/04f0e2d2924a_add_source_id_as_primary_key_for_timed_beliefs.py
This file contains 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,39 @@ | ||
"""add source id as primary key for timed beliefs | ||
Revision ID: 04f0e2d2924a | ||
Revises: e62ac5f519d7 | ||
Create Date: 2021-04-10 13:53:22.561718 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "04f0e2d2924a" | ||
down_revision = "e62ac5f519d7" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.drop_constraint("timed_belief_pkey", "timed_belief") | ||
op.create_primary_key( | ||
"timed_belief_pkey", | ||
"timed_belief", | ||
[ | ||
"event_start", | ||
"belief_horizon", | ||
"cumulative_probability", | ||
"sensor_id", | ||
"source_id", | ||
], | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_constraint("timed_belief_pkey", "timed_belief") | ||
op.create_primary_key( | ||
"timed_belief_pkey", | ||
"timed_belief", | ||
["event_start", "belief_horizon", "cumulative_probability", "sensor_id"], | ||
) |
This file contains 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 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 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 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 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