Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
exclude:
- os: windows-latest
python-version: '3.10'
python-version: ['3.8', '3.9', '3.10', '3.11']
#exclude:
# - os: windows-latest
# python-version: '3.10'

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down
15 changes: 8 additions & 7 deletions photometry/tasoc_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
.. codeauthor:: Rasmus Handberg <[email protected]>
"""

import psycopg2 as psql
from psycopg2.extras import DictCursor
import psycopg
from psycopg.rows import dict_row
import getpass
import contextlib
import random
Expand All @@ -24,8 +24,8 @@ class TASOC_DB(object): # pragma: no cover
Connection to the central TASOC database.

Attributes:
conn (`psycopg2.Connection` object): Connection to PostgreSQL database.
cursor (`psycopg2.Cursor` object): Cursor to use in database.
conn (:class:`psycopg.Connection`): Connection to PostgreSQL database.
cursor (:class:`psycopg.Cursor`): Cursor to use in database.
"""

def __init__(self, username=None, password=None):
Expand All @@ -49,8 +49,9 @@ def __init__(self, username=None, password=None):
password = getpass.getpass('Password: ')

# Open database connection:
self.conn = psql.connect('host=10.28.0.127 user=' + username + ' password=' + password + ' dbname=db_aadc')
self.cursor = self.conn.cursor(cursor_factory=DictCursor)
self.conn = psycopg.connect('host=10.28.0.127 user=' + username + ' password=' + password + ' dbname=db_aadc',
autocommit=False)
self.cursor = self.conn.cursor(row_factory=dict_row)

#----------------------------------------------------------------------------------------------
def close(self):
Expand All @@ -69,6 +70,6 @@ def __exit__(self, *args, **kwargs):
def named_cursor(self, name=None, itersize=2000):
if name is None:
name = 'tasocdb-{0:06d}'.format(random.randint(0, 999999))
named_cursor = contextlib.closing(self.conn.cursor(name=name, cursor_factory=DictCursor))
named_cursor = contextlib.closing(self.conn.cursor(name=name, row_factory=dict_row))
named_cursor.itersize = itersize
return named_cursor
31 changes: 15 additions & 16 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@ flake8
flake8-tabs >= 2.3.2
flake8-builtins
flake8-logging-format
numpy == 1.21.6
scipy == 1.7.3
matplotlib == 3.5.2
astropy == 5.1.0 ; python_version > '3.7'
astropy == 4.3.1 ; python_version <= '3.7'
numpy == 1.24.2
scipy == 1.9.1
matplotlib == 3.7.1
astropy == 5.2.2
PyYAML
photutils == 1.3.0
Bottleneck == 1.3.5
photutils == 1.7.0
Bottleneck == 1.3.7
h5py >= 3.7
scikit-image == 0.19.2
scikit-learn == 1.0.2
statsmodels == 0.13.2
opencv-python-headless == 4.5.5.64
psycopg2-binary
scikit-image == 0.20.0
scikit-learn == 1.2.2
statsmodels == 0.13.5
opencv-python-headless == 4.7.0.72
psycopg
requests >= 2.5
responses
httpretty
astroquery >= 0.4 # Needed for halophot
autograd == 1.4 # Needed for halophot
future == 0.16.0 # Needed for halophot
halophot == 0.7.6.1
autograd >= 1.4 # Needed for halophot
#halophot == 0.7.6.1
git+https://github.com/rhandberg/halophot.git@fix-sklearn#egg=halophot
jplephem >= 2.9
spiceypy == 5.0.1
spiceypy == 5.1.2