-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add Python DB API backend #400
Draft
khaeru
wants to merge
28
commits into
main
Choose a base branch
from
feature/py-backend
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.
Draft
Conversation
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
Codecov Report
@@ Coverage Diff @@
## master #400 +/- ##
======================================
Coverage 96.7% 96.8%
======================================
Files 37 37
Lines 4247 4248 +1
======================================
+ Hits 4111 4116 +5
+ Misses 136 132 -4
|
- list_items(), init_item(), item_index(), item_set_elements()
Add a fallback implementation in Scenario.has_solution() to be used when a backend does not define this method.
This code was incorrectly placed in a concrete Backend implementation. It actually applies to all usage of the public Platform and TimeSeries APIs.
khaeru
force-pushed
the
feature/py-backend
branch
from
April 6, 2021 20:50
195720b
to
3665e9d
Compare
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Do not merge.
This PR adds
ixmp.backend.dbapi
, a proof-of-concept/partially-implemented Backend based on the Python DB API 2.0 (PEP 249). The purpose is explorative: to provide an informed estimate of how much & what kind of work would be needed to actually add such a Backend. As of 2021-02-23, no work is ongoing on this PR; it exists only for information and to collect discussion below.Discussion
Databases
sqlite3
module in the Python standard library, so there are no added dependencies.cx_Oracle
is a DB API 2.0-compliant package that connects to Oracle databases. It handles the same kind of connections we currently use through JDBC (docs).psycopg2
or-3
.Schema
.ixmp.backend.legacy
or similar that is tailored to that existing database structure.Remaining work
Some of the things that would need to be done to complete this implementation:
ixmp.backend.io
toixmp.io.excel
,ixmp.io.gdx
, etc. for better organization.ixmp/ixmp/tests/core/test_timeseries.py
Lines 133 to 148 in 281e84e
test_mp
fixture) to run some or all existing tests on both JDBC- and DatabaseBackend - backed Platforms.See also
backend-xarray
, an earlier experiment in a similar direction.How to review
N/A, discussion only.
PR checklist