Skip to content
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

Explicily force catalogdb.sdss_dr16_qso.psfmag to become a peewee ArrayField. #36

Merged
merged 5 commits into from
Jul 21, 2020

Conversation

tdwelly
Copy link
Contributor

@tdwelly tdwelly commented Jul 21, 2020

Also, added two new postgres profiles to ease psql communication via ssh tunnels.

Add two postgres profiles to ease psql communication via ssh tunnel.
@tdwelly tdwelly requested a review from albireox as a code owner July 21, 2020 12:33
@coveralls
Copy link

coveralls commented Jul 21, 2020

Pull Request Test Coverage Report for Build 300

  • 0 of 4 (0.0%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage remained the same at 0.0%

Changes Missing Coverage Covered Lines Changed/Added Lines %
python/sdssdb/peewee/sdss5db/catalogdb.py 0 2 0.0%
python/sdssdb/utils/internals.py 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
python/sdssdb/peewee/sdss5db/catalogdb.py 1 0%
python/sdssdb/utils/internals.py 1 0%
Totals Coverage Status
Change from base Build 298: 0.0%
Covered Lines: 0
Relevant Lines: 5147

💛 - Coveralls

Copy link
Member

@albireox albireox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tdwelly. I've made a couple changes to the PR. The reason why the psfmag was not being automatically considered an array is because Peewee didn't include single precision floats as array times (same thing happens with doubles). I've added it so in principle it's not necessary anymore to manually specify it in SDSS_DR16_QSO, but there's no harm in leaving it.

I've removed the sdss_tunnel_operations since it's the same as tunnel_operations but with a different user. You can become admin (i.e., the sdss user) by doing

>>> from sdssdb.peewee.sdss5db import catalogdb
>>> catalogdb.database.set_profile('tunnel_operations')
>>> catalogdb.database.become_admin()
>>> catalogdb.database.connect_params
{'password': '4-replicant', 'user': 'sdss', 'host': 'localhost', 'port': 7502}

Have a look and feel free to merge.

@tdwelly
Copy link
Contributor Author

tdwelly commented Jul 21, 2020

Hi @albireox

My use case for the 'tunnel_operations_sdss' profile was to allow running the command line interface to target_selection as the 'sdss' user, remotely over an ssh tunnel, without having to modify the Carton code.

e.g. something like this:

i) set up ssh tunnel to operations.sdss.org using personal account u1234567@eboss.sdss.org
remote-terminal1#> ssh -X -l u1234567 -L 7502:operations.sdss.org:5432 eboss.sdss.org cat -

ii) then run target selection
remote-terminal2#> target_selection --profile tunnel_operations_sdss --include bhm_aqmes_med --keep --overwrite '0.1.0' --write-table

Maybe there's another way of doing this that avoids defining a new profile? I'm happy to keep the 'tunnel_operations_sdss' profile on a non-master branch if it's only me that will use it.

Cheers,
Tom

@albireox
Copy link
Member

I see! Yes, for that you can do

remote-terminal2#> target_selection --profile tunnel_operations_sdss --user sdss run --include bhm_aqmes_med --keep --overwrite '0.1.0' --write-table

That will override the user in the profile but leave the rest the same. In general, you don't need to fork the branch to add a new profile. You can also add one in ~/.config/sdss/sdssdb.yml. For example

sdss_tunnel_operations:
    user: sdss
    host: localhost
    port: 7502

and that profile will be added to your list of profiles.

@tdwelly tdwelly merged commit ff82a73 into master Jul 21, 2020
@tdwelly
Copy link
Contributor Author

tdwelly commented Jul 21, 2020

ok great, of course there was an easier way!

@tdwelly tdwelly deleted the bhm_feat1 branch July 21, 2020 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants