Add Python DB API backend#400
Draft
khaeru wants to merge 28 commits into
Draft
Conversation
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.
195720b to
3665e9d
Compare
6 tasks
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
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
sqlite3module in the Python standard library, so there are no added dependencies.cx_Oracleis 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).psycopg2or-3.Schema
.ixmp.backend.legacyor 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.iotoixmp.io.excel,ixmp.io.gdx, etc. for better organization.ixmp/ixmp/tests/core/test_timeseries.py
Lines 133 to 148 in 281e84e
test_mpfixture) 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