Skip to content

Commit

Permalink
bumped version numbers to 1.3.0 and updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Schonfeld committed Oct 29, 2019
1 parent c3c759f commit 1f319ae
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ Changelog
* calling `show()` now returns an object which can alter the state of a process
* accessing/altering state through the `data` property
* shutting down a process using the `kill()` function

### 1.3.0 (2019-10-29)
* `webbrowser` integration (the ability to automatically open a webbrowser upon calling `dtale.show()`)
* flag for hiding the "Shutdown" button for long-running demos
* "Instances" navigator popup for viewing all activate D-Tale instances for the current python process
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ $ pip install --upgrade dtale
Now you will have to ability to use D-Tale from the command-line or within a python-enabled terminal

### 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|
|`--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|

Loading data from **arctic**
```bash
dtale --arctic-host mongodb://localhost:27027 --arctic-library jdoe.my_lib --arctic-node my_node --arctic-start 20130101 --arctic-end 20161231
Expand Down Expand Up @@ -135,6 +145,14 @@ d.data = tmp

# Shutting down D-Tale process
d.kill()

# using Python's `webbrowser` package it will try and open your server's default browser to this process
d.open_browser()

# There is also some helpful metadata about the process
d._port # the process's port
d._url # the url to access the process

```

## UI
Expand Down Expand Up @@ -198,6 +216,37 @@ Selecting/Deselecting Columns
|--------|:------:|
|![About-up-to-date](https://raw.githubusercontent.com/manahl/dtale/master/docs/images/About-up-to-date.png "About - Out of Date")|![About-out-of-date](https://raw.githubusercontent.com/manahl/dtale/master/docs/images/About-out-of-date.png "About - Up to Date")|

- **Instances**: This will give you information about other D-Tale instances are running under your current Python process.

For example, if you ran the following script:
```python
import pandas as pd
import dtale

dtale.show(pd.DataFrame([dict(foo=1, bar=2, biz=3, baz=4, snoopy_D_O_double_gizzle=5)]))
dtale.show(pd.DataFrame([
dict(a=1, b=2, c=3, d=4),
dict(a=2, b=3, c=4, d=5),
dict(a=3, b=4, c=5, d=6),
dict(a=4, b=5, c=6, d=7)
]))
dtale.show(pd.DataFrame([range(6), range(6), range(6), range(6), range(6), range(6)]), name="foo")
```
This will make the **Instances** button available in all 3 of these D-Tale instances. Clicking that button while in the first instance invoked above will give you this popup:

![Instances](https://raw.githubusercontent.com/manahl/dtale/master/docs/images/Instances.png "Instances")
* Grid with the following information
* Process: timestamp when the process was started along with the name (if specified in `dtale.show()`)
* Rows: number of rows
* Columns: number of columns
* Column Names: comma-separated string of column names (only first 30 characters, hover for full listing)
* Preview: this button is available any of the non-current instances. Clicking this will bring up left-most 5X5 grid information for that instance
* The row highlighted in green signifys the current D-Tale instance
* Any other row can be clicked to switch to that D-Tale instance

Here is an example of clicking the "Preview" button:

![Instances_w_preview](https://raw.githubusercontent.com/manahl/dtale/master/docs/images/Instances_preview.png "Instances Preview")

- Resize: mostly a fail-safe in the event that your columns are no longer lining up. Click this and should fix that
- Shutdown: pretty self-explanatory, kills your D-Tale session (there is also an auto-kill process that will kill your D-Tale after an hour of inactivity)
Expand Down
Binary file modified docs/images/Browser1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Col_select.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Info_menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Info_menu_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Instances.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Instances_preview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Menu_one_col.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.2.0'
version = u'1.3.0'
# The full version, including alpha/beta/rc tags.
release = u'1.2.0'
release = u'1.3.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dtale",
"version": "1.2.0",
"version": "1.3.0",
"description": "Numeric Data Viewer",
"main": "main.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run_tests(self):

setup(
name="dtale",
version="1.2.0",
version="1.3.0",
author="MAN Alpha Technology",
author_email="ManAlphaTech@man.com",
description="Web Client for Visualizing Pandas Objects",
Expand Down
11 changes: 11 additions & 0 deletions tests/dtale/test_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import mock
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import pytest
Expand Down Expand Up @@ -66,6 +67,16 @@ def test_show(unittest):
data_hook.open_browser()
assert 'http://localhost:9999' == webbrowser_instance.open.mock_calls[1][1][0]

# RangeIndex test
test_data = pd.DataFrame([1, 2, 3])
with ExitStack() as stack:
mock_run = stack.enter_context(mock.patch('dtale.app.DtaleFlask.run', mock.Mock()))
mock_find_free_port = stack.enter_context(mock.patch('dtale.app.find_free_port', mock.Mock(return_value=9999)))
stack.enter_context(mock.patch('socket.gethostname', mock.Mock(return_value='localhost')))
mock_logger = stack.enter_context(mock.patch('dtale.app.logger', mock.Mock()))
data_hook = show(data=test_data, subprocess=False, name='foo')
assert np.array_equal(data_hook.data['0'].values, test_data[0].values)

def mock_run(self, *args, **kwargs):
assert self.jinja_env.auto_reload
assert self.config['TEMPLATES_AUTO_RELOAD']
Expand Down

0 comments on commit 1f319ae

Please sign in to comment.