Skip to content

Commit

Permalink
Bug Fixes 20200106
Browse files Browse the repository at this point in the history
- additional information about how to use Correlations popup
- handling of all-nan data in charts popup
- styling issues on popups (especially Histogram)
- removed auto-filtering on correlation popup
- scatter point color change
- added chart icon to cell that has been selected in correlation popup
- responsiveness to scatter charts
- handling of links to 'main','iframe' & 'popup' missing data_id
- handling of 'inf' values when getting min/max & describe data
- added header to window popups (correlations, charts, ...) and a link back to the grid
- added egg building to cirleci script
- correlation timeseries chart hover line
  • Loading branch information
Andrew Schonfeld committed Jan 9, 2020
1 parent 68c4592 commit e489066
Show file tree
Hide file tree
Showing 46 changed files with 705 additions and 167 deletions.
46 changes: 42 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ defaults: &defaults
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
CODECOV_TOKEN: b0d35139-0a75-427a-907b-2c78a762f8f0
VERSION: 1.6.8
PANDOC_RELEASES_URL: https://github.com/jgm/pandoc/releases
steps:
- checkout
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
Expand Down Expand Up @@ -52,7 +54,17 @@ defaults: &defaults
name: Build JS
command: |
yarn run build
- run: sudo apt-get install pandoc
- run:
name: Install Latest pandoc
command: |
# the 'latest' URL redirects to the name of the latest tag.
export PANDOCVERSION=$(curl -I "$PANDOC_RELEASES_URL/latest" | sed -ne 's#Location:.*tag/\(.*\)$#\1#p' | tr -d "\n\r")
echo $PANDOCVERSION # Show pandoc version in logs
export PANDOC_FILE=pandoc-$PANDOCVERSION-1-amd64.deb
echo $PANDOC_FILE
wget $PANDOC_RELEASES_URL/download/$PANDOCVERSION/$PANDOC_FILE
sudo dpkg -i $PANDOC_FILE
rm $PANDOC_FILE
- run:
name: Create and activate virtualenv
command: |
Expand Down Expand Up @@ -91,6 +103,35 @@ defaults: &defaults
cp -r ./htmlcov /tmp/circleci-test-results
python setup.py build_sphinx
cp -r ./build /tmp/circleci-artifacts
# Build egg
- run:
name: Build egg
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
set -e
. ci/bin/activate
pip install pypandoc
pip install docutils
pip install Pygments
grep version setup.py | grep -q $VERSION || (echo "ERROR: Version number not found in setup.py: $VERSION"; exit 1)
grep -q $VERSION CHANGES.md || (echo "ERROR: Version number not found in CHANGES.md: $VERSION"; exit 1)
grep -q $VERSION docker/2_7/Dockerfile || (echo "ERROR: Version number not found in docker/2_7/Dockerfile: $VERSION"; exit 1)
grep -q $VERSION docker/3_6/Dockerfile || (echo "ERROR: Version number not found in docker/3_6/Dockerfile: $VERSION"; exit 1)
grep -q $VERSION docs/source/conf.py || (echo "ERROR: Version number not found in docs/source/conf.py: $VERSION"; exit 1)
grep -q $VERSION package.json || (echo "ERROR: Version number not found in package.json: $VERSION"; exit 1)
python setup.py --long-description > ../README.rst
# pandoc --from=markdown --to=rst --output=../README.rst README.md
cat ../README.rst | rst2html.py 1> ../README.html 2> ../log
cp ../README.rst /tmp/circleci-artifacts
cp ../log /tmp/circleci-artifacts
if [ -s ../log ] ; then
exit 1
fi # rst2html.py alwaysexits with 0, check log size
python setup.py bdist_wheel --universal
python setup.py bdist_egg
python setup.py sdist
cp -r ./dist /tmp/circleci-artifacts
fi
# Save test results
- store_test_results:
path: /tmp/circleci-test-results
Expand All @@ -99,9 +140,6 @@ defaults: &defaults
path: /tmp/circleci-artifacts
- store_artifacts:
path: /tmp/circleci-test-results



version: 2
jobs:
build_2_7:
Expand Down
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
## Changelog

### 1.6.8 (2020-1-9)
* additional information about how to use Correlations popup
* handling of all-nan data in charts popup
* styling issues on popups (especially Histogram)
* removed auto-filtering on correlation popup
* scatter point color change
* added chart icon to cell that has been selected in correlation popup
* responsiveness to scatter charts
* handling of links to 'main','iframe' & 'popup' missing data_id
* handling of 'inf' values when getting min/max & describe data
* added header to window popups (correlations, charts, ...) and a link back to the grid
* added egg building to cirleci script
* correlation timeseries chart hover line

### 1.6.7 (2020-1-3)

* [#50](https://github.com/man-group/dtale/issues/50): updates to rolling correlation functionality
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ One thing of note is that alot of the modal popups you see in the standard brows
|Column Menus|Correlations|Describe|Histogram|Charts|Instances|
|:------:|:------:|:------:|:------:|:------:|:------:|
|![](https://raw.githubusercontent.com/man-group/dtale/master/docs/images/Column_menu.png)|![](https://raw.githubusercontent.com/man-group/dtale/master/docs/images/correlations_popup.png)|![](https://raw.githubusercontent.com/man-group/dtale/master/docs/images/describe_popup.png)|![](https://raw.githubusercontent.com/man-group/dtale/master/docs/images/histogram_popup.png)|![](https://raw.githubusercontent.com/man-group/dtale/master/docs/images/charts_popup.png)|![](https://raw.githubusercontent.com/man-group/dtale/master/docs/images/instances_popup.png)|

### Command-line
Base CLI options (run `dtale --help` to see all options available)

|Prop|Description|
|:--------|------|
|`--host`|the name of the host you would like to use (most likely not needed since `socket.gethostname()` should figure this out)|
|`--port`|the port you would like to assign to your D-Tale instance|
|`--name`|an optional name you can assign to your D-Tale instance (this will be displayed in the `<title>` & Instances popup)|
|Prop |Description|
|:--------|:-----------|
|`--host` |the name of the host you would like to use (most likely not needed since `socket.gethostname()` should figure this out)|
|`--port` |the port you would like to assign to your D-Tale instance|
|`--name` |an optional name you can assign to your D-Tale instance (this will be displayed in the `<title>` & Instances popup)|
|`--debug`|turn on Flask's "debug" mode for your D-Tale instance|
|`--no-reaper`|flag to turn off auto-reaping subprocess (kill D-Tale instances after an hour of inactivity), good for long-running displays |
|`--open-browser`|flag to automatically open up your server's default browser to your D-Tale instance|
Expand Down
2 changes: 1 addition & 1 deletion docker/2_7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ WORKDIR /app

RUN set -eux \
; . /root/.bashrc \
; easy_install dtale-1.6.7-py2.7.egg
; easy_install dtale-1.6.8-py2.7.egg
2 changes: 1 addition & 1 deletion docker/3_6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ WORKDIR /app

RUN set -eux \
; . /root/.bashrc \
; easy_install dtale-1.6.7-py3.7.egg
; easy_install dtale-1.6.8-py3.7.egg
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
# built documents.
#
# The short X.Y version.
version = u'1.6.7'
version = u'1.6.8'
# The full version, including alpha/beta/rc tags.
release = u'1.6.7'
release = u'1.6.8'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 3 additions & 2 deletions dtale/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
from dtale.cli.clickutils import retrieve_meta_info_and_version, setup_logging
from dtale.utils import (build_shutdown_url, build_url, dict_merge, get_host,
running_with_flask_debug, swag_from)
from dtale.views import DATA, DtaleData, cleanup, is_up, kill, startup
from dtale.views import (DATA, DtaleData, cleanup, head_data_id, is_up, kill,
startup)

if PY3:
import _thread
Expand Down Expand Up @@ -217,7 +218,7 @@ def root():
:return: 302 - flask.redirect('/dtale/main')
"""
return redirect('/dtale/main/1')
return redirect('/dtale/main/{}'.format(head_data_id()))

@app.route('/favicon.ico')
def favicon():
Expand Down
14 changes: 7 additions & 7 deletions dtale/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
src: url("../fonts/Road_Rage.woff?v1") format("woff"), url("../fonts/Road_Rage.ttf?v1") format("truetype"), url("../fonts/Road_Rage.svg?v1#road_rage") format("svg");
}

.menu-font {
.title-font {
font-family: "road_rage", Fallback, sans-serif;
font-size: 20px;
text-align: center;
Expand Down Expand Up @@ -8125,10 +8125,6 @@ div#content.admin {
padding-top: 0;
}

div#popup-content {
padding-top: .5em;
}

div.debug {
padding-top: 4em;
}
Expand Down Expand Up @@ -9948,19 +9944,22 @@ select.form-control:focus,
.modal-body .chart-wrapper {
margin: 1em -1em 0;
border: 0;
border-top: solid 1px #ebedee;
}

.modal-body.scatter-body .chart-wrapper {
margin: 0 -1em 0;
border: 0;
border-top: solid 1px #ebedee;
}

.modal-body.scatter-body .chart-wrapper {
border-top: none;
}

.modal-body.scatter-body .row {
margin-left: 0;
margin-right: 0;
}


.modal-header .close {
cursor: pointer;
Expand Down Expand Up @@ -10170,6 +10169,7 @@ div.hoverable.label > div.hoverable__content {
padding: 1em;
height: 25em;
border-radius: 0.25rem;
position: relative;
}

.menu-scrollable {
Expand Down
19 changes: 18 additions & 1 deletion dtale/templates/dtale/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,29 @@

{% block full_content %}
<div class="container-fluid {{js_prefix}}">
<div id="popup-content">
<div class="row" style="margin: 0">
<div class="col-auto">
<header>
<span class="title-font">D-TALE</span>
<span style="font-size: 16px" class="pl-4">{{'- ' + js_prefix.capitalize()}}</span>
</header>
</div>
<div class="col"></div>
<div class="col-auto mt-4" style="{{'padding-right: 125px' if config.GITHUB_FORK else ''}}">
<a href="#" onclick="window.open('/dtale/main/{{data_id}}'); return false;">
<i class="fas fa-th mr-4"></i>
<span>Back To Data</span>
</a>
</div>
</div>
<div id="popup-content" />
</div>
{% endblock %}

{% set js_file = 'dist/' + js_prefix + '_popup_bundle.js' %}
{% block js %}
<script type="text/javascript">
const backToData = () => window.open('/dtale/main/{{data_id}}');
</script>
<script type="text/javascript" src="{{ url_for('static', filename=js_file) }}"></script>
{% endblock %}
7 changes: 5 additions & 2 deletions dtale/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,22 @@ def json_int(x, nan_display='', as_string=False):
DECIMAL_CTX.prec = 20


def json_float(x, precision=2, nan_display='nan', as_string=False):
def json_float(x, precision=2, nan_display='nan', inf_display='inf', as_string=False):
"""
Convert value to float to be used within JSON output
:param x: value to be converted to integer
:param precision: precision of float to be returned
:param nan_display: if `x` is :attr:`numpy:numpy.nan` then return this value
:param inf_display: if `x` is :attr:`numpy:numpy.inf` then return this value
:param as_string: return float as a formatted string (EX: 1,234.5643)
:return: float value
:rtype: float
"""
try:
if not np.isnan(x) and not np.isinf(x):
if np.isinf(x):
return inf_display
if not np.isnan(x):
output = float(round(x, precision))
if as_string:
str_output = format(DECIMAL_CTX.create_decimal(repr(x)), ',.{}f'.format(str(precision)))
Expand Down
Loading

0 comments on commit e489066

Please sign in to comment.