diff --git a/doc/source/_static/ansys_dt.png b/doc/source/_static/ansys_dt.png index b381f014..ad4ec4f9 100644 Binary files a/doc/source/_static/ansys_dt.png and b/doc/source/_static/ansys_dt.png differ diff --git a/doc/source/api/examples/index.rst b/doc/source/api/examples/index.rst new file mode 100644 index 00000000..aa1638e5 --- /dev/null +++ b/doc/source/api/examples/index.rst @@ -0,0 +1,14 @@ +.. _ref_index_api_example: + +Other Functions +=============== + +Other useful functions available and used for the examples implemented (see :ref:`ref_example_gallery`). + +.. currentmodule:: pytwin + +.. autosummary:: + :toctree: _autosummary + + pytwin.download_file + pytwin.load_data \ No newline at end of file diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst index 45c4ba44..ff2d66f2 100644 --- a/doc/source/api/index.rst +++ b/doc/source/api/index.rst @@ -27,6 +27,10 @@ Global Settings :ref:`ref_index_api_logging` describe the global settings (e.g. logging and working directory options) available from PyTwin package and how to change them from their default values +Other Functions +--------------- + +Additional useful functions used for the examples implementation are described in :ref:`ref_index_api_example`. .. currentmodule:: pytwin @@ -40,3 +44,4 @@ PyTwin package and how to change them from their default values sdk/index evaluate/index logging/index + examples/index diff --git a/src/ansys/pytwin/examples/downloads.py b/src/ansys/pytwin/examples/downloads.py index 28798509..201ab6c9 100644 --- a/src/ansys/pytwin/examples/downloads.py +++ b/src/ansys/pytwin/examples/downloads.py @@ -128,11 +128,10 @@ def download_file( Returns ------- str - Path to the folder containing all example data files. + Path to the downloaded file. Examples -------- - Download an example result file and return the path of the file >>> from pytwin import examples >>> path = examples.download_file("CoupledClutches_23R1_other.twin", "twin_files", force_download=True) """ @@ -146,8 +145,25 @@ def download_file( def load_data(inputs: str): - """Load a CSV input file into a Pandas Dataframe. Inputs is the path of the CSV file to be loaded, - containing the Time column and all the Twin inputs data""" + """ + Load a CSV input file into a Pandas Dataframe. + + Parameters + ---------- + inputs : str + Path of the CSV file to be loaded, containing the Time column and all the Twin inputs data. + + Returns + ------- + inputs_df: pandas.DataFrame + A ``pandas.DataFrame`` storing time values as well as all the corresponding input data. + + Examples + -------- + >>> from pytwin import load_data, download_file + >>> csv_input = download_file("CoupledClutches_input.csv", "twin_input_files") + >>> twin_model_input_df = load_data(csv_input) + """ # Clean CSV headers if exported from Twin builder def clean_column_names(column_names): diff --git a/src/ansys/pytwin/settings.py b/src/ansys/pytwin/settings.py index 53a87790..edf49391 100644 --- a/src/ansys/pytwin/settings.py +++ b/src/ansys/pytwin/settings.py @@ -9,6 +9,19 @@ class PyTwinLogLevel(Enum): """ Enum to choose logging level to be used by all pytwin objects. It follows standard python logging levels. + + PYTWIN_LOG_DEBUG: + Detailed information, typically of interest only when diagnosing problems. + PYTWIN_LOG_INFO: + Confirmation that things are working as expected. + PYTWIN_LOG_WARNING: + An indication that something unexpected happened, or indicative of some problem in the near future + (e.g. ‘disk space low’). The software is still working as expected. + PYTWIN_LOG_ERROR: + Due to a more serious problem, the software has not been able to perform some function. + PYTWIN_LOG_CRITICAL: + A serious error, indicating that the program itself may be unable to continue running. + """ PYTWIN_LOG_DEBUG = logging.DEBUG