Skip to content

Commit

Permalink
Merge branch 'release/2.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
thespacedoctor committed Jun 14, 2023
2 parents ec50a1f + 6074a70 commit 391637f
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

## Release Notes

**v2.2.3 - April 3, 2023**

* **FIXED**: GAIA DR2 stars not getting matched as synonyms in default algorithm.

**v2.2.2 - May 18, 2022**

**FIXED**: NED name parsing errors fixed
Expand Down
12 changes: 12 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cff-version: 1.2.0
title: sherlock
message: If you use this software, please cite it as below.
authors:
- family-names: "Young"
given-names: "David R."
orcid: "https://orcid.org/0000-0002-1229-2499"
doi: 10.5281/zenodo.7970743
url: "https://github.com/thespacedoctor/sherlock"
abstract: mine a library of historical and on-going astronomical survey data in an attempt to identify the sources of transient/variable events, and predict their classifications based on crossmatched data.
keywords: [astronomy]
license: GPL-3.0-only
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ recursive-exclude */tests *
recursive-exclude */*/tests *
recursive-exclude */*/*/tests *
recursive-exclude tests
prune tests*
global-exclude *_test.py
global-exclude tests
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# sherlock


[![](https://zenodo.org/badge/42115533.svg)](https://zenodo.org/badge/latestdoi/42115533)


<!-- INFO BADGES -->

[![](https://img.shields.io/pypi/pyversions/qub-sherlock)](https://pypi.org/project/qub-sherlock/)
Expand All @@ -23,3 +27,20 @@ Documentation for sherlock is hosted by [Read the Docs](https://qub-sherlock.rea
## Features

*



## How to cite sherlock

If you use `sherlock` in your work, please cite using the following BibTeX entry:

```bibtex
@software{Young_sherlock,
author = {Young, David R.},
doi = {10.5281/zenodo.8038058},
license = {GPL-3.0-only},
title = {{sherlock}},
url = {https://github.com/thespacedoctor/sherlock}
}
```

3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ git+https://github.com/readthedocs/readthedocs-sphinx-search@main
docopt
unicodecsv
psutil>5.7
jinja2==3.0.0
Markdown==3.3.4
importlib-metadata==4.13.0
9 changes: 6 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
import codecs

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo',
'sphinx.ext.mathjax', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.linkcode', 'sphinxcontrib.mermaid', 'sphinx_search.extension']
'sphinx.ext.mathjax', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.linkcode', 'sphinxcontrib.mermaid', 'sphinx_search.extension', 'sphinx.ext.imgconverter']


class Mock(MagicMock):
"""AVOID INSTALLING THESE C-DEPENDENT PACKAGES"""
@classmethod
def __getattr__(cls, name):
return Mock()


MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.colors',
'matplotlib.pyplot', 'matplotlib.cm', 'matplotlib.path', 'matplotlib.patches', 'matplotlib.projections', 'matplotlib.projections.geo', 'healpy', 'astropy', 'astropy.io', 'pylibmc', 'ligo', 'ligo.gracedb', 'ligo.gracedb.rest', 'pandas', 'HMpTy', 'HMpTy.mysql', 'HMpTy.htm']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
Expand Down Expand Up @@ -56,7 +58,7 @@ def __getattr__(cls, name):
# Toc options
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 4,
'navigation_depth': 1,
'includehidden': True,
'titles_only': False,
'github_user': 'thespacedoctor',
Expand Down Expand Up @@ -263,7 +265,7 @@ def generateAutosummaryIndex():
# FOR SUBPACKAGES USE THE SUBPACKAGE TEMPLATE INSTEAD OF DEFAULT MODULE
# TEMPLATE
if len(allModules):
thisText = """
thisText = """
Modules
-------
Expand Down Expand Up @@ -437,6 +439,7 @@ def setup(app):
markdown_parser_config, True)
app.add_transform(AutoStructify)


# DO THE WORK
updateUsageMd()
autosummaryText = generateAutosummaryIndex()
7 changes: 7 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fulltest:
pytest -v -s --profile-svg --profile
for i in prof/*.prof; do gprof2dot -f pstats $i | dot -Tsvg -o $i.svg; done

litetest:
pytest -m "not full" -v -s --profile-svg --profile
for i in prof/*.prof; do gprof2dot -f pstats $i | dot -Tsvg -o $i.svg; done
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
full: mark test to run only in full test (deselect with '-m "not full"')
serial
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def readme():
with open(moduleDirectory + '/README.md') as f:
return f.read()


install_requires = [
'pyyaml',
'qub-sherlock',
Expand Down Expand Up @@ -51,7 +52,7 @@ def readme():
author='David Young',
author_email='davidrobertyoung@gmail.com',
license='MIT',
packages=find_packages(),
packages=find_packages(exclude=["*tests*"]),
include_package_data=True,
install_requires=install_requires,
test_suite='nose2.collector.collector',
Expand Down
2 changes: 1 addition & 1 deletion sherlock/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.2.2'
__version__ = '2.2.3'
3 changes: 2 additions & 1 deletion sherlock/advanced_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 1
database-batch-size: 20000
cpu-pool-size: False

stop-search-on-synonym-match: False
stop-search-on-synonym-match: True

## SEARCH ALGORITHM SETTINGS
ned stream search radius arcec: 900
Expand Down Expand Up @@ -109,6 +109,7 @@ search algorithm:
association: BS
general:
angular radius arcsec: 2.5
synonym: VS
association: VS
gaia galaxy:
database table: tcs_view_unclear_gaia_dr2
Expand Down
114 changes: 114 additions & 0 deletions sherlock/resources/package.mplstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@



ps.papersize : A4 # auto, letter, legal, ledger, A0-A10, B0-B10

### LINES
lines.linewidth : 1.0 # line width in points
lines.linestyle : - # solid line
lines.color : blue # has no affect on plot(); see axes.color_cycle
lines.marker : None # the default marker
lines.markeredgewidth : 0.3 # the line width around the marker symbol
lines.markersize : 8 # markersize, in points
lines.antialiased : True # render lines in antialised (no jaggies)

### FONT
# When text.usetex is False, font.family may also be one or more concrete font names.
font.family : sans-serif # serif, sans-serif, cursive, fantasy, monospace
font.style : normal # normal, italic, oblique
font.variant : normal # normal, small-caps
font.weight : medium # normal, bold, bolder, lighter, 100, 200, 300, ..., 900
font.stretch : normal # ultra-condensed, extra-condensed, condensed, semi-condensed, normal, semi-expanded, expanded, extra-expanded, ultra-expanded, wider, narrower
font.size : 12.0


### AXES
#axes.hold : True # whether to clear the axes by default on
axes.facecolor : white # axes background color
axes.edgecolor : 002b36 # axes edge color
axes.linewidth : 2.0 # edge linewidth
axes.grid : True # display grid or not
axes.titlesize : large # xx-small, x-small, small, medium, large, x-large, xx-large, larger, smaller
axes.labelsize : medium # xx-small, x-small, small, medium, large, x-large, xx-large, larger, smaller
axes.labelweight : normal # normal, bold, bolder, lighter, 100, 200, 300, ..., 900
axes.labelcolor : 002b36
axes.axisbelow : False # gridlines and ticks are below the axes elements
axes.formatter.limits : -5, 5 # use scientific notation if log10 of the axis range is smaller than the first or larger than the second
axes.formatter.use_locale : False
axes.formatter.use_mathtext : False
axes.unicode_minus : True # use unicode for the minus symbol rather than hyphen. See
axes.prop_cycle : cycler('color', ["dc322f", "268bd2", "859900", "2aa198", "d33682", "cb4b16", "6c71c4", "b58900"]) # color cycle for plot lines (blue, red, green, cyan, magneta, orange, violet, yellow)

### TICKS
xtick.major.size : 6 # major tick size in points
xtick.minor.size : 3 # minor tick size in points
xtick.major.width : 0.9 # major tick width in points
xtick.minor.width : 0.9 # minor tick width in points
xtick.major.pad : 4 # distance to major tick label in points
xtick.minor.pad : 2 # distance to the minor tick label in points
xtick.color : 002b36 # color of the tick labels
xtick.labelsize : small # xx-small, x-small, small, medium, large, x-large, xx-large, larger, smaller
xtick.direction : in # direction: in, out, or inout
ytick.major.size : 6 # major tick size in points
ytick.minor.size : 3 # minor tick size in points
ytick.major.width : 0.9 # major tick width in points
ytick.minor.width : 0.9 # minor tick width in points
ytick.major.pad : 4 # distance to major tick label in points
ytick.minor.pad : 2 # distance to the minor tick label in points
ytick.color : 002b36 # color of the tick labels
ytick.labelsize : small # xx-small, x-small, small, medium, large, x-large, xx-large, larger, smaller
ytick.direction : in # direction: in, out, or inout


### GRIDS
grid.color : 002b36 # grid color
grid.linestyle : : # dotted
grid.linewidth : 0.5 # in points
grid.alpha : 0.7 # transparency, between 0.0 and 1.0


### LEGEND
legend.fancybox : False # if True, use a rounded box for the legend, else a rectangle
legend.numpoints : 1 # the number of points in the legend line
legend.fontsize : small
legend.borderpad : 0.8 # border whitespace in fontsize units
legend.markerscale : 0.8 # the relative size of legend markers vs. original the following dimensions are in axes coords
legend.labelspacing : 0.7 # the vertical space between the legend entries in fraction of fontsize
legend.handlelength : 1.5 # the length of the legend lines in fraction of fontsize
legend.handleheight : 1.0 # the height of the legend handle in fraction of fontsize
legend.handletextpad : 0.2 # the space between the legend line and legend text in fraction of fontsize
legend.borderaxespad : 1.0 # the border between the axes and legend edge in fraction of fontsize
legend.columnspacing : 0. # the border between the axes and legend edge in fraction of fontsize
legend.shadow : False
legend.frameon : True # whether or not to draw a frame around legend
legend.scatterpoints : 2 # number of scatter points


### FIGURE
figure.figsize : 8, 6 # figure size in inches
figure.dpi : 150 # figure dots per inch
figure.facecolor : E6E5E5 # figure facecolor; 0.75 is scalar gray
figure.edgecolor : white # figure edgecolor

## subplot parameters - dimensions are a fraction of the figure
figure.subplot.left : 0.125 # the left side of the subplots of the figure
figure.subplot.right : 0.9 # the right side of the subplots of the figure
figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure
figure.subplot.top : 0.9 # the top of the subplots of the figure
figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots
figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots


### SAVING FIGURES
path.simplify : True # remove "invisible" points to reduce file size
path.simplify_threshold : 0.1 # The threshold of similarity below which vertices will be removed
path.snap : True # When True, rectilinear axis-aligned paths will be snapped to the nearest pixel
savefig.dpi : 100 # figure dots per inch
savefig.facecolor : white # figure facecolor when saving
savefig.edgecolor : white # figure edgecolor when saving
savefig.format : png # png, ps, pdf, svg
savefig.bbox : standard # 'tight' or 'standard'.
savefig.pad_inches : 0.1 # Padding to be used when bbox is set to 'tight'



9 changes: 8 additions & 1 deletion sherlock/transient_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,12 +1263,19 @@ def _print_results_to_stdout(

printCrossmatches.append(ordDict)

outputFormat = None
# outputFormat = "csv"

from fundamentals.renderer import list_of_dictionaries
dataSet = list_of_dictionaries(
log=self.log,
listOfDictionaries=printCrossmatches
)
tableData = dataSet.table(filepath=None)

if outputFormat == "csv":
tableData = dataSet.csv(filepath=None)
else:
tableData = dataSet.table(filepath=None)

print(tableData)

Expand Down

0 comments on commit 391637f

Please sign in to comment.