Skip to content

Commit

Permalink
To solve issue #13
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqicn committed Dec 13, 2021
1 parent cc5eb4d commit 18c4b5b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
41 changes: 33 additions & 8 deletions test_guis.ipynb → examples.ipynb
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "1da0c89d",
"metadata": {},
"source": [
"# Examples of using MeteoVis\n",
"To import meteovis for using, firstly run the following cell. This will automatically generate the necessary folders under your working directory (./dataset, ./cache, and ./temp)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "9b6e0151",
"id": "5c5b11b1",
"metadata": {},
"outputs": [],
"source": [
"import meteovis as mv"
]
},
{
"cell_type": "markdown",
"id": "1a414f76",
"metadata": {},
"source": [
"#### Process files to dataset"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "50fb44ef",
"id": "d27d81ec",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2051ca4f878343ef850c68e1722b0c6b",
"model_id": "077a86ffbcff4152ab0b310168385278",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HTML(value=\"<b style='font-size: large'>Process files to dataset</b>\"), FileChooser(path='/Volu"
"VBox(children=(HTML(value=\"<p><b style='font-size: large'>Process files to dataset</b><p><p>Please make sure t"
]
},
"metadata": {},
Expand All @@ -35,16 +52,24 @@
"mv.process_data()"
]
},
{
"cell_type": "markdown",
"id": "218481a0",
"metadata": {},
"source": [
"#### Working with datasets"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "c5862ddf",
"execution_count": 3,
"id": "1ab34604",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "bf2167b1b01f4eb68d3b29f6ccdbf920",
"model_id": "76083498edbf40e499361a2f82c43aa4",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -80,7 +105,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.12"
}
},
"nbformat": 4,
Expand Down
18 changes: 15 additions & 3 deletions meteovis/meteovis.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def process_data():

# define the GUI
w_title = widgets.HTML(
value="<b style='font-size: large'>Process files to dataset</b>"
value="<p><b style='font-size: large'>Process files to dataset</b><p>" +
"<p>Please make sure that:</p>" +
"<p>1. All the files you want to process are directly under the folder you select.</p>" +
"<p>2. All the files processed in one round are collected from the same radar.</p>"
)
w_path = FileChooser(
title="<b>Select data folder</b>",
Expand All @@ -47,7 +50,7 @@ def process_data():
options=[
"",
"pvol",
"era5"
# "era5"
]
)
w_options = widgets.VBox()
Expand Down Expand Up @@ -274,7 +277,16 @@ def operate_datasets(dir_path=DATASET_DIR):
w_update = widgets.Button(description="Update")
w_tabs.children += (
widgets.VBox([
widgets.HTML("<b>Input your equation to update a dataset</b>"),
widgets.HTML("<p><b>Input your equation to update a dataset</b></p>" +
"<p>Supported Operations:</p>" +
"<p>1. Math operations: +, -, *, /, ** (power), // (floor division), % (Modulus).</p>" +
"<p>2. Logic operations: >, <, >=, <=, ==, !=, & (logical and), | (logical or).</p>" +
"<p>Examples: </p>" +
"<p>1. ds ** (1/2): computing square root of the dataset.</p>" +
"<p>2. (ds<0) | (ds>10): removing value in [0, 10] from the dataset." +
"<p>Tips: </p>" +
"<p>1. Primary of operations can be indicated with (), like the first example shows.</p>" +
"<p>2. Mix of math and logic operations is not allowed, e.g., ((ds<0) | (ds>10))**(1/2) won't work out.</p>"),
widgets.HBox([
w_update_input,
w_update
Expand Down
File renamed without changes.

0 comments on commit 18c4b5b

Please sign in to comment.