Skip to content

Commit 31b4bc1

Browse files
authored
Merge pull request #167 from mgckind/1.4.6
1.4.6
2 parents d57bca5 + a524856 commit 31b4bc1

File tree

11 files changed

+379
-126
lines changed

11 files changed

+379
-126
lines changed

AUTHORS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Contributors to `easyaccess`
2+
This is an alphabetical list of contributors, if you feel you have contributed to the project and we have neglected adding you to the list please accept our apologizes and [let us know](mailto:[email protected]) to correct it.
3+
4+
- Matias Carrasco Kind
5+
- Alex Drlica-Wagner
6+
- Landon Gelman
7+
- Audrey Koziol
8+
- Donald Petravick
9+
- Eli Rykoff
10+
- Ignacio Sevilla

CHANGES.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
# Changes
22

3+
## v1.4.6
4+
#### 2019-JAN-14
5+
- No minor changes to the code, just the general documentation
6+
- Adding Contribution guidelines and Coda of Conduct
7+
- Adding Authors
8+
- Adding FAQ
9+
- Updating Readme and Installation instructions
10+
- Reformatting code
11+
- Update paper and references
12+
13+
314
## v1.4.5
415
#### 2018-OCT-04
516
- Restructuring code structure (PR #151)
617
- Add paper reference
718
- Minor fixes in unitests
8-
- Update documentation
19+
- Update documentation
920
- Fix conda issues
1021

1122
## v1.4.4

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributing to `easyaccess`
2+
3+
4+
When contributing to this repository, please first discuss the change you wish to make via [issues](https://github.com/mgckind/easyaccess/issues),
5+
[email](mailto:[email protected]), or any other method with the owners of this repository before making a change.
6+
7+
Please note we have a [code of conduct](CODE_OF_CONDUCT.md) for this project, please follow it in all your interactions with the project.
8+
9+
## Reporting Bugs
10+
11+
When creating a bug or an issue please include as many details as possible. Create your issues [here](https://github.com/mgckind/easyaccess/issues) and follow this steps:
12+
13+
- Check [previous closed issues](https://github.com/mgckind/easyaccess/issues?q=is%3Aissue+is%3Aclosed) , [current open issues](https://github.com/mgckind/easyaccess/issues?q=is%3Aopen+is%3Aissue) or our FAQ for a list of common questions or previously solved problems
14+
- Use a clear and descriptive title for the issue to identify the problem.
15+
- Provide all information about OS
16+
- Provide information about the installation process (source, pip, conda, Docker, etc)
17+
- software version including Python
18+
- Detailed information on how to reproduce the problem
19+
- Provide screenshots when useful
20+
21+
## Other contributions
22+
23+
All kind of contributions are welcome, from fixing bugs, resolving issues or suggesting features. Look at the [current issues](https://github.com/mgckind/easyaccess/issues) to see how you can contribute and provide help.
24+
25+
## Pull Request Process
26+
27+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
28+
build.
29+
2. Update the README.md with details of changes to the interface, this includes new environment
30+
variables, exposed ports, useful file locations and container parameters.
31+
3. Increase the version numbers in any examples files and the README.md to the new version that this
32+
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
33+
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
34+
do not have permission to do that, you may request the second reviewer to merge it for you.
35+
36+
## Authors
37+
38+
Please see our [list of contributors](AUTHORS.md), if you feel you have contributed to the project and we have neglected adding you to the list please accept our apologizes and [let us know](mailto:[email protected]) to correct it.
39+
40+

FAQ.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Frequently Asked Questions
2+
3+
Here we collect a list of FAQ related to installation, usage, etc. Please refre to the [issues page](https://github.com/mgckind/easyaccess/issues) for more information.
4+
5+
- The installation with `pip` went smoothly but it was not obvious where "easyaccess" was installed.
6+
- When installed using pip, one can use the following: `pip show -f easyaccess` to check the installation folders
7+
8+
- When trying to connect I keep getting this error `ORA-21561: OID generation failed`. Any idea how to solve it?
9+
- Most of the time this problem can be solved by adding the name of your computer in the `/etc/hosts` file, next to the line that says 127.0.0.1 localhost. Just add the name of your computer (type `hostname`) to that line, so it looks like `127.0.0.1 localhost my-computer`
10+
- Where is the configuration file and authentication file?
11+
- Usually the configuration file by default is at `$HOME/.easyaccess/config.ini` and the authentication file is at `$HOME/.desservices.ini` or can be set at the env variable `$DES_SERVICES`
12+
- I am a DES Collaborator, where can I reset my credentials?
13+
- For collaborators only: Please use [this](https://deslogin.wufoo.com/forms/help-me-with-my-desdm-account/) form
14+
- The client hangs after getting an Oracle error and I need to close to the window.
15+
- This is a long-standing [issue](https://github.com/mgckind/easyaccess/issues/130) but we haven't been able to fix it or to reproduce it in all the systems. Please report it there and add details about OS and versions. We'd recommend a clean conda installation which sometimes fixes the issue.
16+
- How can I install the Oracle client by myself.
17+
- Please follow the instructions posted [here](https://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html)
18+
- Are there other requirements besides python modules and Oracle clients?
19+
- Usually not, for new OS or Virtual Machines you'd need to install `libaio` and `libbz2`
20+
- How can I contribute to the project?
21+
- Please take a look st our [Code of Conduct](CODE_OF_CONDUCT.md) and or [contribution guide](CONTRIBUTING.md)
22+

README.md

Lines changed: 93 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
# easyaccess <a href="https://github.com/mgckind/easyaccess/releases/tag/1.4.5"> <img src="https://img.shields.io/badge/release-v1.4.5-blue.svg" alt="latest release" /></a> <a href="https://github.com/mgckind/easyaccess/blob/master/LICENSE.txt"><img src="https://img.shields.io/badge/license-NCSA%20License-blue.svg" alt="License" /> </a> <a href="https://pypi.python.org/pypi/easyaccess/1.4.5"><img src="https://img.shields.io/badge/pypi-v1.4.5-orange.svg" alt="pypi version"/></a><a href="https://anaconda.org/mgckind/easyaccess"> <img src="https://img.shields.io/badge/Anaconda Cloud-v1.4.5-blue.svg" /> </a>
2-
![help_screen](data/help.gif)
1+
# easyaccess <a href="https://github.com/mgckind/easyaccess/releases/tag/1.4.6"> <img src="https://img.shields.io/badge/release-v1.4.6-blue.svg" alt="latest release" /></a> <a href="https://github.com/mgckind/easyaccess/blob/master/LICENSE.txt"><img src="https://img.shields.io/badge/license-NCSA%20License-blue.svg" alt="License" /> </a> <a href="https://pypi.python.org/pypi/easyaccess/1.4.6"><img src="https://img.shields.io/badge/pypi-v1.4.6-orange.svg" alt="pypi version"/></a> ![](https://img.shields.io/conda/v/mgckind/easyaccess.svg) ![](https://img.shields.io/conda/pn/mgckind/easyaccess.svg) ![](https://img.shields.io/badge/python-2.7%7C3.6-blue.svg)
32

4-
Enhanced command line SQL interpreter client for astronomical databases.
3+
Enhanced command line SQL interpreter client for astronomical surveys.
4+
![help_screen](data/help.gif)
55

6-
Python Command Line Interpreter to access Oracle DES DB
7-
using cx_Oracle
6+
## Description
7+
`easyaccess` is an enhanced command line interpreter and Python package created to facilitate access to astronomical catalogs stored in SQL Databases. It provides a custom interface with custom commands and was specifically designed to access data from the Dark Energy Survey Oracle database, including autocompletion of tables, columns, users and commands, simple ways to upload and download tables using csv, fits and HDF5 formats, iterators, search and description of tables among others. It can easily be extended to another surveys or SQL databases. The package was completely written in Python and support customized addition of commands and functionalities.
88

99
For a short tutorial check [here](http://matias-ck.com/easyaccess)
1010

11-
**Current version = 1.4.5**
11+
**Current version = 1.4.6**
1212

13+
#### DES DR1 users
1314
For DES public data release, you can start `easyaccess` with:
1415

1516
easyaccess -s desdr
@@ -18,24 +19,89 @@ To create an account click [here](https://des.ncsa.illinois.edu/easyweb/signup/)
1819

1920
## Requirements
2021

21-
- Oracle Client > 11g.2 (External library, no python)
22-
Check [here](https://opensource.ncsa.illinois.edu/confluence/display/DESDM/Instructions+for+installing+Oracle+client+and+easyaccess+without+EUPS) for instructions on how to install these libraries
23-
- [cx_Oracle](https://bitbucket.org/anthony_tuininga/cx_oracle)
24-
25-
Note that cx_Oracle needs libaio on some Linux systems (e.g., #98)
26-
27-
Note that cx_Oracle needs libbz2 on some Linux systems
22+
- [Oracle Client](https://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html) > 11g.2 (External library, no python)
23+
Check [here](https://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html) for instructions on how to install these libraries
24+
- [cx_Oracle](https://cx-oracle.readthedocs.io/en/latest/index.html)
25+
- Note that cx_Oracle needs libaio on some Linux systems
26+
- Note that cx_Oracle needs libbz2 on some Linux systems
2827
- [fitsio](https://github.com/esheldon/fitsio) >= 0.9.6
2928
- [pandas](http://pandas.pydata.org/) >= 0.14
29+
- [numpy](https://docs.scipy.org/doc/numpy-1.15.1/reference/index.html)
3030
- [termcolor](https://pypi.python.org/pypi/termcolor)
3131
- [PyTables](http://pytables.github.io/) (optional, for hdf5 output)
3232
- [future](http://python-future.org/) (for python 2/3 compatibility)
3333
- [requests](http://docs.python-requests.org/en/master/)
3434
- [gnureadline](https://github.com/ludwigschwardt/python-gnureadline) (optional, for better console behavior in OS X)
35-
- importlib (This is only needed if running python 2.6)
3635

36+
## Installation
37+
38+
Installing `easyaccess` can be a little bit tricky given the external libraries required, in particular the Oracle libraries which are free to use. `easyaccess` is based heavily on the Oracle python client `cx_Oracle`, you can follow the installation instructions from [here](https://cx-oracle.readthedocs.io/en/latest/installation.html#quick-start-cx-oracle-installation). For `cx_Oracle` to work, you will need the Oracle Instant Client packages which can be obtained from [here](https://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html).
39+
40+
Make sure you have these libraries installed before proceeding to the installation of easyaccess, you can try by opening a Python interpreter and type:
41+
42+
import cx_Oracle
43+
44+
If you have issues, please check the [Troubleshooting page](https://cx-oracle.readthedocs.io/en/latest/installation.html#troubleshooting) or our [FAQ page](FAQ.md).
45+
46+
#### Source Installation
47+
48+
You can clone this repository and install `easyaccess` with:
49+
50+
python setup.py install
51+
52+
#### Pip installation
53+
`easyaccess` can also be installed using `pip` but it'd require the installation of the oracle instant client first as described above
54+
55+
pip install easyaccess==1.4.6
56+
57+
or directly from github:
58+
59+
pip install git+https://github.com/mgckind/easyaccess.git
60+
61+
#### Conda installation
62+
For Collaborators, now easyaccess can be installed using [conda](http://conda.pydata.org/docs/install/quick.html) out of the box!
3763

38-
## Some *nice* features
64+
conda install easyaccess==1.4.6 -c mgckind -c anaconda
65+
66+
#### Docker
67+
For collaborators, We have a Docker image with easyaccess pre-installed which you can obtained from:
68+
69+
docker pull mgckind/easyaccess
70+
71+
## FAQ
72+
We have a running list of [FAQ](FAQ.md) which we will constantly update, please check [here](FAQ.md).
73+
74+
#### Contributing
75+
Please take a look st our [Code of Conduct](CODE_OF_CONDUCT.md) and or [contribution guide](CONTRIBUTING.md).
76+
77+
78+
## Citation
79+
If you use `easyaccess` in your work we would encourage to use this reference [https://arxiv.org/abs/1810.02721](https://arxiv.org/abs/1810.02721) or copy/paste this BibTeX:
80+
```
81+
@ARTICLE{2018arXiv181002721C,
82+
author = {{Carrasco Kind}, M. and {Drlica-Wagner}, A. and {Koziol}, A.~M.~G. and
83+
{Petravick}, D.},
84+
title = "{easyaccess: Enhanced SQL command line interpreter for astronomical surveys}",
85+
journal = {arXiv e-prints},
86+
keywords = {Astrophysics - Instrumentation and Methods for Astrophysics},
87+
year = 2018,
88+
month = Oct,
89+
eid = {arXiv:1810.02721},
90+
pages = {arXiv:1810.02721},
91+
archivePrefix = {arXiv},
92+
eprint = {1810.02721},
93+
primaryClass = {astro-ph.IM},
94+
adsurl = {https://ui.adsabs.harvard.edu/\#abs/2018arXiv181002721C},
95+
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
96+
}
97+
```
98+
99+
100+
## Usage
101+
102+
For a short tutorial and documentation see [here](http://matias-ck.com/easyaccess), note that not all the features are available for the public use, i.e., DR1 users.
103+
104+
#### Some *great* features
39105
- Nice output format (using pandas)
40106
- Very flexible configuration
41107
- Smart tab autocompletion for commands, table names, column names, and file paths
@@ -48,23 +114,14 @@ To create an account click [here](https://des.ncsa.illinois.edu/easyweb/signup/)
48114
- Show the execution plan of a query if needed
49115
- Python functions can be run in a inline query
50116

51-
## Conda installation
52-
Now easyaccess can be installed using [conda](http://conda.pydata.org/docs/install/quick.html) out of the box!
53-
54-
conda install easyaccess==1.4.5 -c mgckind
55-
56-
## Pip installation
57-
easyaccess can also be installed using `pip` but it'd require the installation of the oracle instant client first
58117

59-
pip install easyaccess==1.4.5
60-
61-
## Interactive interpreter
118+
#### Interactive interpreter
62119

63120
Assuming that ```easyaccess``` is in your path, you can enter the interactive interpreter by calling ```easyaccess``` without any command line arguments:
64121

65122
easyaccess
66123

67-
### Running SQL commands
124+
#### Running SQL commands
68125
Once inside the interpreter run SQL queries by adding a ";" at the end::
69126

70127
DESDB ~> select ... from ... where ... ;
@@ -75,15 +132,15 @@ To save the results into a table add ">" after the end of the query (after ";")
75132

76133
The file types supported so far are: .csv, .tab, .fits, and .h5. Any other extension is ignored.
77134

78-
### Load tables
135+
#### Load tables
79136
To load a table it needs to be in a csv format with columns names in the first row
80137
the name of the table is taken from filename or with optional argument --tablename
81138

82139
DESDB ~> load_table <filename> --tablename <mytable> --chunksize <number of rows to read/upload> --memsize <memory in MB to read at a time>
83140

84141
The --chunsize and --memsize are optional arguments to facilitate uploading big files.
85142

86-
### Load SQL queries
143+
#### Load SQL queries
87144
To load SQL queries just run:
88145

89146
DESDB ~> loadsql <filename.sql>
@@ -93,7 +150,7 @@ or
93150

94151
The query format is the same as the interpreter, SQL statement must end with ";" and to write output files the query must be followed by " > <output file>"
95152

96-
### Configuration
153+
#### Configuration
97154

98155
The configuration file is located at ```$HOME/.easyaccess/config.ini``` but everything can be configured from inside easyaccess type:
99156

@@ -111,8 +168,14 @@ and to see any particular option (e.g., timeout):
111168

112169
DESDB ~> config timeout show
113170

114-
## Command line usage
171+
#### Command line usage
115172

116173
Much of the functionality provided through the interpreter is also available directly from the command line. To see a list of command-line options, use the ```--help``` option
117174

118175
easyaccess --help
176+
177+
## Architecture
178+
179+
We have included a simplified UML diagram describing the architecture and dependencies of `easyaccess` which shows only the different methods for a given class and the name of the file hosting a given class. The main class, `easy_or()`, inherits all methods from all different subclasses, making this model flexible and extendable to other surveys or databases. These methods are then converted to command line commands and functions that can be called inside `easyaccess`. Given that there are some DES specific functions, we have moved DES methods into a separate class `DesActions()`.
180+
181+
![`easyaccess` architecture diagram](paper/classes_simple.png)

0 commit comments

Comments
 (0)