Skip to content

Commit

Permalink
updating submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed Jul 16, 2018
2 parents 2161bca + e8cc4c3 commit e6cfb73
Show file tree
Hide file tree
Showing 21 changed files with 275 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.2.6dev
current_version = 2.3.0dev
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<release>[a-z]+)?
Expand Down
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- **NEVER INCLUDE PLAINTEXT PASSWORDS OR PRIVATE INFORMATION IN THE BUG REPORT** -->

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari] (if the issue is related to Marvin Web)
- Version of Marvin [e.g. 2.0.2]

**Additional context**
Add any other context about the problem here.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve

---

<!-- **NEVER INCLUDE PLAINTEXT PASSWORDS OR PRIVATE INFORMATION IN THE BUG REPORT** -->

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Fixes #

This pull request:
- [ ] Has a title that summarises what is changing.
- [ ] Updates the documentation accordingly.
- [ ] Has unit tests & [code coverage](https://coveralls.io/github/sdss/marvin) is not adversely affected (within reason).
- [ ] Works with Python 2.7 and 3.6 (and ideally with Python 3.7).
- [ ] Updates the [CHANGELOG](https://github.com/sdss/marvin/blob/master/CHANGELOG.rst).
- [ ] Removes more lines of code than it adds.
- [ ] If relevant, adds a new entry to the [What's new?](https://github.com/sdss/marvin/blob/master/docs/sphinx/whats-new.rst) page.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ matrix:
notifications:
slack:
secure: FZXERPoPv4n52hBx3bvEjJ5T0Ey2Es7Sa7sd/MA4AMr7l1771YZ1VTLpVtpw4qJR8vrt4NtSFbBowJiovDmx6FCjEb/2N6RipjbLowAtFRqjalOGO3KZOi3UPeiytP/IYD1DG7YmeYJOL8aof2awns8ckAWRSz6HO3cDpqg+hycDXasZQdQfIKgY17UZvONBJZCZGeC3lMw4IrbhkfhW7aQvhUhcXDtfEyObNt2+FGE6y7WDeOEjtfArKc/Iz4gybWLkYPpA6rtQfQciQvpZv94sanxli8vq4mXIpu/dxn73jfKSYsYIl7+OYrXKJQBy/8muwwuSe2et15mG90KGUsDOJ+PXKCLOSl8JohO/pH0l3hZKno6nX7byL6orEbBuQjpMJO0QFUs7o6hLSv3q4tgtuV0M99I8UHcIgmBYL9oXI4BHIsSwreTXHfV/8LiuZfyaB2NzwKuRHQTZQfCD+ujqXaspyQX70Xew2L7rruRuBuKLTntgklMFtAPYJYbW/4z6HsZ//X6Z2BHwe0Etv4FZaKsf8IK81p//oYi/3kw2ENRYNARu0HzU0Edba6ugBPjzw6wFyWsL35IFTSosby50iAWo7xYfRXBv1kH0tPOcmPoJzFcrdAmvEqt6K8bNwqgx72/qsBp4fhmGfQM5G07dkyQM+hu+e9OPEfTwOo4=
email: false
branches:
except:
- mpl6
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Marvin's Change Log
===================

[2.2.6] - 2018/?/?
[2.3.0] - 2018/?/?
--------------------

Changed
Expand All @@ -28,6 +28,11 @@ Fixed
- Issue `#421 <https://github.com/sdss/marvin/issues/421>`_ - query returning spaxel props returns wrong total count
- Bugfix - Python 3 xrange syntax bug in buildImageDict

Changed
^^^^^^^
- Extra keyword arguments passed to ``Spectrum.plot`` are now forwarded to ``Axes.plot``.
- Tools (e.g., ``Cube``, ``Maps``) can now be accessed from the ``marvin`` namespace (e.g., ``marvin.tools.Cube`` or ``marvin.tools.cube.Cube``).


[2.2.5] - 2018/04/26
--------------------
Expand Down
84 changes: 84 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Code of Conduct

## 1. Purpose

A primary goal of Marvin is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).

This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.

We invite all those who participate in Marvin to help us create safe and positive experiences for everyone.

## 2. Open Source Citizenship

A supplemental goal of this Code of Conduct is to increase open source citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.

Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.

If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know.

## 3. Expected Behavior

The following behaviors are expected and requested of all community members:

* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
* Exercise consideration and respect in your speech and actions.
* Attempt collaboration before conflict.
* Refrain from demeaning, discriminatory, or harassing behavior and speech.
* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.

## 4. Unacceptable Behavior

The following behaviors are considered harassment and are unacceptable within our community:

* Violence, threats of violence or violent language directed against another person.
* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
* Posting or displaying sexually explicit or violent material.
* Posting or threatening to post other people’s personally identifying information ("doxing").
* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
* Inappropriate photography or recording.
* Inappropriate physical contact. You should have someone’s consent before touching them.
* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
* Deliberate intimidation, stalking or following (online or in person).
* Advocating for, or encouraging, any of the above behavior.
* Sustained disruption of community events, including talks and presentations.

## 5. Consequences of Unacceptable Behavior

Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.

Anyone asked to stop unacceptable behavior is expected to comply immediately.

If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).

## 6. Reporting Guidelines

If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. ombuds@sdss.org.

[Reporting Guidelines](https://www.sdss.org/collaboration/the-sloan-digital-sky-survey-code-of-conduct/)

Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.

## 7. Addressing Grievances

If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify SDSS with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.

[Policy](https://www.sdss.org/collaboration/the-sloan-digital-sky-survey-code-of-conduct/)

## 8. Scope

We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues–online and in-person–as well as in all one-on-one communications pertaining to community business.

This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.

## 9. Contact info

ombuds@sdss.org

## 10. License and attribution

This Code of Conduct is distributed under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).

Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).

Retrieved on November 22, 2016 from [http://citizencodeofconduct.org/](http://citizencodeofconduct.org/)
7 changes: 4 additions & 3 deletions docs/sphinx/tutorials/plotting-tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ Quick Model Fit Plot
# must use Maps.getSpaxel() to get modelcube
# (the bracket slicing of Maps does not return the modelcube)
spax = maps.getSpaxel(x=17, y=17, xyorig='lower', model=True)
ax = spax.flux.plot()
ax.plot(spax.full_fit.wavelength, spax.full_fit.value)
ax.legend(list(ax.get_lines()), ['observed', 'model'])
# extra arguments to plot are passed to the matplotlib routine
ax = spax.flux.plot(label='observed)
ax.plot(spax.full_fit.wavelength, spax.full_fit.value, label='model')
ax.legend()
.. image:: ../_static/quick_model_plot.png
Expand Down
4 changes: 4 additions & 0 deletions docs/sphinx/whats-new.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.. _whats-new:

What's New in Marvin 2.3.0 (unreleased)
=======================================


What's New in Marvin 2.2 (January 2018)
=======================================

Expand Down
20 changes: 15 additions & 5 deletions python/marvin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import six
from collections import OrderedDict

# Set the Marvin version
__version__ = '2.3.0dev'

# Does this so that the implicit module definitions in extern can happen.
from marvin import extern

Expand Down Expand Up @@ -42,14 +45,17 @@
log = initLog(logFilePath)

warnings.simplefilter('once')
warnings.filterwarnings('ignore', 'Skipped unsupported reflection of expression-based index')
warnings.filterwarnings('ignore', '(.)+size changed, may indicate binary incompatibility(.)+')
# warnings.filterwarnings('ignore', 'Skipped unsupported reflection of expression-based index')
# warnings.filterwarnings('ignore', '(.)+size changed, may indicate binary incompatibility(.)+')
warnings.filterwarnings('ignore', category=FITSFixedWarning)

# Filters for PY3
# TODO: undestand why these warnings are issued and fix the root of the problem (JSG)
# This warning seems harmless (see https://github.com/astropy/astropy/issues/6025) so
# will ignore it for now.
warnings.filterwarnings('ignore', 'can\'t resolve package(.)+')
warnings.filterwarnings('ignore', 'unclosed file <_io.TextIOWrapper+')

# Ignore DeprecationWarnings that are not Marvin's
warnings.filterwarnings('ignore', category=DeprecationWarning)
warnings.filterwarnings('once', category=DeprecationWarning, module='marvin')


class MarvinConfig(object):
Expand Down Expand Up @@ -677,3 +683,7 @@ def login(self, refresh=None):
from marvin.api.api import Interaction
from marvin.api.base import arg_validate

# Provide access to base submodules from the marvin namespace
from . import tools
from . import db
from . import utils
4 changes: 2 additions & 2 deletions python/marvin/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def _parse_input(value):

return_dict = {'plate': None, 'ifu': None, 'mangaid': None}

plateifu_pattern = re.compile('([0-9]{4,5})\-([0-9]{4,9})')
plateifu_pattern = re.compile(r'([0-9]{4,5})-([0-9]{4,9})')
ifu_pattern = re.compile('(7|127|[0-9]{2})([0-9]{2})')
mangaid_pattern = re.compile('[0-9]{1,3}\-[0-9]+')
mangaid_pattern = re.compile(r'[0-9]{1,3}-[0-9]+')
plateid_pattern = re.compile('([0-9]{4,})(?!-)(?<!-)')

plateid_match = re.match(plateid_pattern, value)
Expand Down
15 changes: 9 additions & 6 deletions python/marvin/db/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@
The example given is for a PostgreSQL database, but can be modified for any other.
'''
from __future__ import print_function
from __future__ import division
from __future__ import division, print_function

import os

import yaml
from marvin import config
from marvin.db.DatabaseConnection import DatabaseConnection
from pgpasslib import getpass
from marvin import config
import yaml
import os


# Read in the db connection configuration
dbconfigfile = 'dbconfig.ini'
dbconfigfile = os.path.join(os.path.dirname(os.path.abspath(__file__)), dbconfigfile)

try:
rawfile = open(dbconfigfile, 'r').read()
with open(dbconfigfile, 'r') as ff:
rawfile = ff.read()

except IOError as e:
raise RuntimeError('IOError: Could not open dbconfigfile {0}:{1}'.format(dbconfigfile, e))
dbdict = yaml.load(rawfile)
Expand Down
2 changes: 1 addition & 1 deletion python/marvin/extern/tree
33 changes: 33 additions & 0 deletions python/marvin/tests/test_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2018-07-09
# @Filename: test_imports.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: José Sánchez-Gallego
# @Last modified time: 2018-07-09 12:11:48

import marvin


class TestImports(object):

def test_access_tools_full_path(self):

assert marvin.tools.plate.Plate is not None
assert marvin.tools.cube.Cube is not None
assert marvin.tools.maps.Maps is not None
assert marvin.tools.modelcube.ModelCube is not None
assert marvin.tools.spaxel.Spaxel is not None
assert marvin.tools.spaxel.Bin is not None

def test_access_tools_from_root(self):

assert marvin.tools.Plate is not None
assert marvin.tools.Cube is not None
assert marvin.tools.Maps is not None
assert marvin.tools.ModelCube is not None
assert marvin.tools.Spaxel is not None
assert marvin.tools.Bin is not None
6 changes: 6 additions & 0 deletions python/marvin/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import cube, maps, modelcube, spaxel
from .cube import Cube
from .maps import Maps
from .modelcube import ModelCube
from .plate import Plate
from .spaxel import Bin, Spaxel
7 changes: 5 additions & 2 deletions python/marvin/tools/quantities/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def std(self):

def plot(self, xlim=None, ylim=None, show_std=True, use_mask=True,
n_sigma=1, xlabel='Wavelength', ylabel='Flux', show_units=True,
plt_style='seaborn-darkgrid', figure=None, return_figure=False):
plt_style='seaborn-darkgrid', figure=None, return_figure=False,
**kwargs):
"""Plots the spectrum.
Displays the spectrum showing, optionally, the :math:`n\\sigma` region,
Expand Down Expand Up @@ -171,6 +172,8 @@ def plot(self, xlim=None, ylim=None, show_std=True, use_mask=True,
return_figure (bool):
If ``True``, the matplotlib `~matplotlib.figure.Figure` object
used will be returned along with the axes object.
kwargs (dict):
Keyword arguments to be passed to `~matplotlib.axes.Axes.plot`.
Returns:
axes:
Expand Down Expand Up @@ -202,7 +205,7 @@ def plot(self, xlim=None, ylim=None, show_std=True, use_mask=True,
value = self.value
wave = self.wavelength.value

ax.plot(wave, value)
ax.plot(wave, value, **kwargs)

if show_std and self.std is not None:
if use_mask is False:
Expand Down
Loading

0 comments on commit e6cfb73

Please sign in to comment.