Skip to content

Commit

Permalink
Version 4 - Release Notes Below
Browse files Browse the repository at this point in the history
Release Notes UQpy v4 – 04/2022

🚀 What's New 

**UQpy Features**

•	RunModel with Open-MPI support

The parallelization framework that drives forward simulation in UQpy is replaced with OpenMPI. This removes tight coupling with the SLURM scheduler for HPC clusters and allows more general HPC adoption of the code.

•	Gaussian Process Regression with Constraints

The Surrogates module is enhanced with the addition of Gaussian Process Regression (GPR) to generalize the previously existing Kriging capability. Data with and with and without noise can be fitted. Base classes enable to user to incorporate custom capabilities. Additionally, the Virtual Point method allows the fitting of a constrained surrogate, with the NonNegativity constraint being currently available and several other constraints under development.

•	Polynomial Chaos Expansion

The Polynomial Chaos surrogate of UQpy was rewritten from scratch to improve performance. Apart from the previous capability of creating a tensor product basis, now total degree basis and hyperbolic truncation are available. The code also has enhanced regression capability for solving the coefficients including the efficient Least Angle Regression method. Additional capabilities including the computation of higher order moments and for first and total order sensitivity indices are incorporated.

**Continuous Integration Features**

•	New software development workflow using Github flow coupled with Cloud-based DevOps

To streamline the development of UQpy and ensure the quality of the delivered product, cloud-based DevOps tools are adopted. Specifically, Azure Pipelines is used for automated code test based on git-related events, such as commits. This ensures quality and functionality of the code throughout the development process.

•	Automated testing using Pytest

With the support of DevOps tools mentioned above, an automated testing framework is established. All classes and modules of UQpy are required to achieve a minimum 80% code coverage. This is attained with the aid of unit tests, that ensure the core functionality is in line with published benchmark results.

•	Automated linting using Pylint

The user is guarded against syntax errors with the aid of Pylint. This static code analysis tool is incorporated as a step of the DevOps pipeline to detect and resolve uncompliant code behavior.

•	Continuous Code Quality using Sonar Cloud

SonarCloud analyzes the code at Pull Requests and detects known bugs, measures the maintainability rating and code smells existing in the code, thus providing an overview of the code quality.


**Coding Conventions**

•	Naming conventions

To align UQpy with python community coding standards, PEP8 is adopted throughout the code. Modules, Classes and function names have been replaced with PascalCase and snake_case conventions wherever appropriate. Full names are now used for attributes and methods to enhance code readability. Note that this changes the names of many modules, classes, and functions in UQpy.

•	Logging infrastructure

Verbosity flags, combined with print statements have been replaced throughout the code with the python logging facility introduced in PEP282. This allows the user a choice of multiple severity levels, depending on the details required. Different handlers enable logging messages to be emitted in output streams ranging from Files and Databases to Http Streams, with the default choice being the console.

•	Type hints

To support user interaction with the UQpy library, type hints introduced in PEP484 are adopted throughout the code. Even though Python runtime does not enforce variable and type annotations, modern Integrated Development Environments (IDEs) guard the user against wrong input data.

📖 **Documentation**

•	New documentation Sphinx template.

Documentation has been ported from the previous template into the most widely adopted template from the open-source community. It is hierarchically restructured in a way that reflects the module and class hierarchy of the code.

•	Jupyter notebooks incorporated in docs with Binder support

All Jupyter notebooks that used to live in a separate folder of the repository are now ported into the documentation. Step-by-step examples accompany each class and illustrate its use across different scenarios. The reader can directly see the results of the examples or alternatively run them interactively in an incorporated Binder environment. All examples are downloadable in both Jupyter notebook and python format.

•	Discussions forum in Github

To enhance interaction with the community, UQpy repository has adopted the Discussion feature available within Github, that serves as a forum for Uncertainty Quantification and code related question. In addition, issue reporting has been enhanced with templates for both bugs and feature requests that help the UQpy developer communicate and address the code issues and functionalities in an expedited manner.

•	Code Citation

The repository has also been enhanced with a citation button that quickly links the user with a bibtex citation for the purposes of academic cross-referencing.



📦 **Library Continuous Delivery**

•	Docker image releases

A new channel for distribution of the UQpy library is through Docker images. Docker images are templates for the creation of Docker containers. They contain the application code, as well as all required dependencies. The exact same environment can be replicated in all Windows, Linux and MacOS platforms. In case multiple nodes are required, all major Infrastructure as a Service (IaaS) providers support the deployment of such containers, while HPC Supercomputing center gradually transition to containerization by supporting open-source container engines such as Singularity/SARUS.

•	Automated semantic versioning

GitVersion tool is used to remove the guesswork related to library versioning. This tool traverses the git tree of the project and automatically calculates the version number of the current release.

•	Automated PyPI package releases

The creation and generation of python packages is now an automated step of the release. When merging the latest version to the master, the code is package uploaded and distributed via the PyPI package manager.

•	Automated no-arch releases in dedicated Anaconda and Conda-forge channels

Like the PyPI, package release is automate in Anaconda. Operating system independent packages are created and distributed automatically in the SURG_JHU and conda-forge channels. As a result, UQpy can be installed and utilized in any python environment regards of the underlying operating system.

•	Automated Github releases

A zipped version of the released version is automatically generated and uploaded directly in the Github repository for users to download and use in case access to the code for a specific version is needed.


⭐ **Improvements**

•	Major refactoring of Sampling, Inference, Surrogates and Dimension Reduction modules.

Three major modules of UQpy are rewritten. Code duplication has been reduced to a minimum, with code readability and extensibility being the top priorities. Abstract classes have been introduced throughout, enable the latter goal by provided specific instructions to the users on how to extend UQpy according to their need and provided additional functionality.


🚢 **Coming Soon**

•	Parallel and Sequential Tempering algorithms

•	Two-dimensional Karhunen-Loeve expansion

•	Sampling-based Sensitivity Indices

•	Adaptive Kriging Sensitivity Indices

•	Geometric Harmonics

•	Further Performance Improvements
  • Loading branch information
mds2120 authored Apr 12, 2022
2 parents ad9b9a6 + 1107273 commit f2f6488
Show file tree
Hide file tree
Showing 824 changed files with 37,524 additions and 39,697 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,10 @@ examples/

# End of https://www.gitignore.io/api/osx,matlab,python,pycharm
logo/
/tests/Transformations/test-output.xml
/.
/process_matlab_output.py
/python_model.py
/python_model_third_party.py
/third_party_script.py
/docs/source/auto_examples/
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ sphinx:
configuration: docs/source/conf.py
fail_on_warning: False
build:
image: latest
os: ubuntu-20.04
tools:
python: "3.9"
python:
version: 3.7
install:
- requirements: docs/requirements.txt
system_packages: true
28 changes: 28 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
title: "UQpy"
version: 3.0.0
date-released: 2021-10-23
url: "https://github.com/SURGroup/UQpy"
preferred-citation:
type: article
authors:
- family-names: "Olivier"
given-names: "Audrey"
- family-names: "Giovanis"
given-names: "Dimitris"
- family-names: "B.S."
given-names: "Aakash"
- family-names: "Chauhan"
given-names: "Mohit"
- family-names: "Vandanapu"
given-names: "Lohit"
- family-names: "Shields"
given-names: "Michael"
doi: "https://doi.org/10.1016/j.jocs.2020.101204"
journal: "Journal of Computational Science"
month: 9
start: 101204
title: "UQpy: A general purpose Python package and development environment for uncertainty quantification"
volume: 47
year: 2020
58 changes: 58 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,63 @@ Alternatively, in case of anaconda distributions
>
> black {uqpy_src_path}
### Logging
___

Since version 4.0.0 UQpy, has transitioned from the legacy verbose flag, to using the logging module of Python. Logging allows the developer to track in several levels of detail the events during code execution. Each one of the levels implies a different level of event severity, ranging from debug message, up to errors that disrupt the execution of the code. Specifically the severity levels are the following:

- Debug
- Info
- Warning
- Critical
- Error

A simple example of using the logging module is by invoking a logger object and calling the function named after the desired level of message severity.

> self.logger = logging.getLogger(__name__)
>
> self.logger.info("UQpy: Log an informational message.")
The current logging level of UQpy is set to **ERROR**, meaning that all data logged in lower severity levels are not displayed. A change of the logging level is performed using the following python code:

> logger.setLevel(logging.INFO)
The input of the set level function is an enumeration, with values the logging severities. The default output of the predefined logger configuration is the console, but python supports using multiple logging output sinks such as files or databases. In order to append a new output type to the existing logging configuration, to log messages and warnings to files the following code can be used:

> formatter = UQpyLoggingFormatter()
>
> file_handler = logging.FileHandler('UQpy.log')
>
> file_handler.setFormatter(formatter)
>
> logger.addHandler(file_handler)
The latter summarize the basic usage of logging framework utilized in UQpy. For a detailed breakdown of the logging module can be found [here](https://docs.python.org/3/howto/logging-cookbook.html "Logging documentation").

### Type hints
___

In [PEP484](https://www.python.org/dev/peps/pep-0484/), Python introduced type hints. Type hints are a way to loosely suggest the type of variables as well as input and output parameters to method. The intention of this syntactic annotation is to suggest the type of variables in order to aid the user/ developer, rather than strictly impose their type.
In case of UQpy, type hints are utilized mainly in the initializers of objects. In versions before 4.0.0, UQpy allowed the user to provide any values and the raised an error is the input value did not had the expected format. This type checking is not replaced with beartype. With the aid of type hinted variables, beartype enforced type safety to functions and method.
The only code addition required for perforing run type checking with beartype is adding the decorator @beartype before method signatures, as illustrated below:

> @beartype
>
> def method(a: float, b: bool, c: int)
>
> pass
>
As can be observed in the function above, variable types are defined by using semicolon, followed by the variable type. The type can be any of the built-in primitive or object data types of Python, or user defined class. In addition, multiple data type can be allowed at the same time by using the Union construct as follows


> def method(a: float, b: bool, c: Union[int, float, None])
>
> pass
>
Even more refined combination of data types are allowed in python type hints. For more information, please refer to [Python Type Hints](https://docs.python.org/3/library/typing.html).

### Docstrings
___
Before uploading a code make sure all new classes and methods added are accompanied by the required docstrings. The [PEP 257](https://www.python.org/dev/peps/pep-0257/ "Docstring conventions") guideline contains the specifications for creating and maintaining the respective code documentation.
Expand Down Expand Up @@ -56,3 +113,4 @@ Sonarcloud is a static code analysis tool that ensures code quality and security

For all contributors, **master** and **Development** branches are protected. As a result no-one can commit directly to these branches. For contributors that belong to the organization, the recommented procedure is to start the branches from **Development** branch. In order for the CI procedure to run automatically, two different naming strategies are followed. Either **feature/{name_of_feature}** in case this branch is used for the development of a non-existing feature, or **bugfix/{name_of_bugfix}** in case the respective branch is used to fix a bug on the existing code. Note that ALL pull requests must point to the Development branch. Any pull requests to the master branch will be closed and should be resubmitted to the Development branch. For external contributors, the suggested procedure is to create a fork of the existing repository. After the contribution is completed, a pull request should be issued to the Development branch of the main repository. In all cases, make sure that all the above CI requirements are satisfied for your pull request to acceptable.

## Type hints
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#RUN curl -fsSL https://get.docker.com -o get-docker.sh
#RUN chmod +x get-docker.sh
#RUN sh get-docker.sh

# Build the image based on the official Python version 3.9 image
FROM python:3.9

# Use RUN to install Python packages (numpy and scipy) via pip, Python's package manager
RUN pip3 install UQpy
28 changes: 25 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
|AzureDevops| |PyPIdownloads| |PyPI| |CondaSURG| |CondaPlatforms| |GithubRelease| |Binder| |Docs|
|AzureDevops| |PyPIdownloads| |PyPI| |CondaSURG| |CondaPlatforms| |GithubRelease| |Binder| |Docs| |bear-ified|

.. |Docs| image:: https://img.shields.io/readthedocs/uqpy?style=plastic :alt: Read the Docs
.. |CondaSURG| image:: https://img.shields.io/conda/vn/SURG_JHU/uqpy?style=plastic :alt: Conda (channel only)
Expand All @@ -10,6 +10,11 @@
.. |Binder| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/SURGroup/UQpy/master

.. |bear-ified| image:: https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg
:align: top
:target: https://beartype.rtfd.io
:alt: bear-ified


*******************************************
Uncertainty Quantification with python (UQpy)
Expand All @@ -19,9 +24,26 @@ Uncertainty Quantification with python (UQpy)

====

:Authors: Michael D. Shields, Dimitris G. Giovanis, Audrey Olivier, Aakash Bangalore Satish, Mohit Singh Chauhan, Lohit Vandanapu, Ketson RM dos Santos, Katiana Kontolati
:Contact: [email protected]
+-----------------------+------------------------------------------------------------------+
| **Product Owner:** | Michael D. Shields |
+-----------------------+------------------------------------------------------------------+
| **Lead Developers:** | Dimitris Giovanis, Audrey Olivier, Dimitris Tsapetis |
+-----------------------+------------------------------------------------------------------+
| **Development Team:** | Aakash Bangalore Satish, Mohit Singh Chauhan, Lohit Vandanapu, |
+ + +
| | Ketson RM dos Santos, Katiana Kontolati, Dimitris Loukrezis, |
+ + +
| | Promit Chakroborty, Lukáš Novák, Andrew Solanto |
+-----------------------+------------------------------------------------------------------+
| **Contributors:** | Michael Gardner |
+-----------------------+------------------------------------------------------------------+

Contact
===========

To engage in conversations about uncertainty quantification, or ask question about UQpy usage and functionality refer to the UQpy's discussions tab:

`Discussions <https://github.com/SURGroup/UQpy/discussions>`_

Description
===========
Expand Down
Loading

0 comments on commit f2f6488

Please sign in to comment.