Update the dump data path & doc for visualization tool (#323)

* image update

* file path change

* dump doc update

* doc update

* doc update
This commit is contained in:
Meroy Chen 2021-04-14 21:44:44 +08:00 коммит произвёл GitHub
Родитель ce8a3a517c
Коммит 4cd516afc6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 38 добавлений и 21 удалений

Просмотреть файл

@ -170,7 +170,7 @@ env = Env(scenario="cim",
options={"enable-dump-snapshot": "./dump_data"})
# Inspect environment with the dump data
maro inspector dashboard --source_path ./dump_data/snapshot_dump_folder
maro inspector dashboard --source_path ./dump_data/YOUR_SNAPSHOT_DUMP_FOLDER
```
### Show Cases

Просмотреть файл

@ -41,7 +41,9 @@ this parameter.
If the value for key "enable-dump-snapshot" of this parameter is an empty string,
data would be dumped to the folder which start the command.
If user specifies the value for key "enable-dump-snapshot" of this parameter with the
path of a local file folder, data would be dumped to this folder.
path of a local file folder, and the dir_path of the local file folder does exist,
data would be dumped to this folder. To be specific, each dump request would generate
a data folder with a timestamp as the suffix in the local file folder.
.. code-block:: sh
@ -71,27 +73,22 @@ To start this visualization tool, user need to input command following the forma
.. code-block:: sh
maro inspector dashboard --source_path {source\_folder\_path} --force {true/false}
----
e.g.
.. code-block:: sh
maro inspector dashboard --source_path .\maro\dumper_files --force false
maro inspector dashboard --source_path SNAPSHOT_DUMP_DATA_FOLDER --force {true/false}
----
Parameter **force** refers to regenerate cross-epoch summary data or not, default value is 'true'.
Parameter **source_path** refers to the path of dumped snapshot files.
The expected structure of file folder should be like this:
Parameter **source_path** refers to the path of dumped snapshot files. Every experiment would
generate a data folder with a timestamp as the suffix, which we refer as SNAPSHOT_DUMP_DATA_FOLDER.
The input of the parameter **source_path** should be the path of SNAPSHOT_DUMP_DATA_FOLDER.
Make sure that your SNAPSHOT_DUMP_DATA_FOLDER's structure is similar as following:
Folder Structure
.. code-block:: sh
./LOCAL_DUMPER_DATA_FOLDER
./SNAPSHOT_DUMP_DATA_FOLDER
epoch_# # folders to restore data of each epoch.
{resource_holder}.csv # attributes of current epoch.
manifest.yml # basic info like scenario name, number of epoches.
@ -102,6 +99,7 @@ Folder Structure
----
If any file is missed compared with the expected folder structure
displayed above, the command line would prompt users with an error message.
The visualization tool looks for the free port to launch page in sequence, starting with port 8501.

Просмотреть файл

@ -12,10 +12,16 @@ local mode for the finished epoch under real-time mode.
Dependency
----------
Env-geographic's startup depends on docker.
Env-geographic's startup depends on **docker** and **docker-compose**.
Therefore, users need to install docker on the machine and ensure that it can run normally.
User could get docker through `Docker installation <https://docs.docker.com/get-docker/>`_.
We suggest that the version of docker should >= 1.20 and the version of docker-compose
should >= 1.27.
For windows users, make sure to switch on your **Hyper-V** service to ensure docker could start successfully.
Besides, users should make sure that their machine could execute **shell commands** in any directory. We suggest
that windows users could install git bash to meet this requirement.
How to Use?
-----------

Просмотреть файл

@ -193,7 +193,8 @@ def _render_intra_view_by_ports(
sample_ratio = helper.get_sample_ratio_selection_list(snapshot_num)
selected_snapshot_sample_ratio = st.sidebar.select_slider(
label="Snapshot Sampling Ratio:",
options=sample_ratio
options=sample_ratio,
value=1
)
# Accumulated data.
helper.render_h1_title("CIM Accumulated Data")
@ -242,7 +243,8 @@ def _render_intra_view_by_snapshot(
sample_ratio = helper.get_sample_ratio_selection_list(ports_num)
selected_port_sample_ratio = st.sidebar.select_slider(
label="Ports Sampling Ratio:",
options=sample_ratio
options=sample_ratio,
value=1
)
# Accumulated data.
helper.render_h1_title("Accumulated Data")
@ -506,7 +508,8 @@ def _generate_intra_panel_vessel(data_vessel: pd.DataFrame, snapshot_index: int,
sample_ratio = helper.get_sample_ratio_selection_list(vessels_num)
selected_vessel_sample_ratio = st.sidebar.select_slider(
label="Vessels Sampling Ratio:",
options=sample_ratio
options=sample_ratio,
value=1
)
down_pooling_sample_list = helper.get_sample_index_list(vessels_num, selected_vessel_sample_ratio)
data_vessel = data_vessel[

Просмотреть файл

@ -229,7 +229,8 @@ def _generate_intra_view_by_snapshot(
# Get sample rate (between 0-1).
selected_station_sample_ratio = st.sidebar.select_slider(
label="Station Sampling Ratio",
options=sample_ratio
options=sample_ratio,
value=1
)
# Get formula input and output.
@ -292,7 +293,8 @@ def _generate_intra_view_by_station(
snapshot_sample_ratio_list = helper.get_sample_ratio_selection_list(snapshot_num)
selected_snapshot_sample_ratio = st.sidebar.select_slider(
label="Snapshot Sampling Ratio:",
options=snapshot_sample_ratio_list
options=snapshot_sample_ratio_list,
value=1
)
# Get formula input and output.
data_formula = helper.get_filtered_formula_and_data(

Просмотреть файл

@ -404,7 +404,8 @@ def _get_sampled_epoch_range(epoch_num: int, sample_ratio: float) -> List[float]
)
down_pooling_num = st.sidebar.select_slider(
label="Epoch Sampling Ratio",
options=sample_ratio
options=sample_ratio,
value=1
)
if down_pooling_num == 0:
return []

Просмотреть файл

@ -0,0 +1,2 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

Просмотреть файл

@ -29,6 +29,11 @@ class DumpConverter:
now = datetime.now()
self._foldername = "snapshot_dump_" + now.strftime("%Y_%m_%d_%H_%M_%S_%f")[:-3]
if parent_path != "":
dir_path = Path(os.path.dirname(parent_path))
if not dir_path.exists():
return
if not Path(parent_path).exists():
os.mkdir(parent_path)
self._foldername = os.path.join(parent_path, self._foldername)
folder_path = Path(self._foldername)