Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/version4' into feature/v…
Browse files Browse the repository at this point in the history
…ersion4

# Conflicts:
#	tests/unit_tests/surrogates/test_gpr.py
  • Loading branch information
mohitcek committed Apr 7, 2022
2 parents 761b2a2 + 4d7a955 commit 03143d3
Show file tree
Hide file tree
Showing 113 changed files with 1,627 additions and 2,288 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sphinx:
build:
image: latest
python:
version: 3.7
version: 3.9
install:
- requirements: docs/requirements.txt
system_packages: true
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
344 changes: 189 additions & 155 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,159 +21,193 @@ pr:
- master
- Development

pool:
vmImage: "macOS-latest"

steps:
- task: UsePythonVersion@0
displayName: "Use Python $(pythonVersion)"
inputs:
versionSpec: "$(pythonVersion)"

- task: gitversion/setup@0
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
displayName: Setup GitVersion
inputs:
versionSpec: '5.x'

- task: gitversion/execute@0
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
displayName: Calculate GitVersion
inputs:
useConfigFile: true
configFilePath: 'GitVersion.yml'

- powershell: |
echo "Current version: $(GitVersion.SemVer)"
displayName: Shows currently compiling version
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- task: SonarCloudPrepare@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.Reason'], 'PullRequest'))
inputs:
SonarCloud: 'SonarCloud.UQpy'
organization: 'jhusurg'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'SURGroup_UQpy'
cliProjectName: 'UQpy'
cliSources: '.'
extraProperties: |
sonar.exclusions=**/example/**, **/tests/**, **/docs/**
sonar.python.coverage.reportPaths=./coverage.xml
# - task: Cache@2
jobs:
- job: "Build_UQpy_and_run_tests"
pool:
vmImage: "macOS-latest"

steps:
- task: UsePythonVersion@0
displayName: "Use Python $(pythonVersion)"
inputs:
versionSpec: "$(pythonVersion)"

- task: gitversion/setup@0
displayName: Setup GitVersion
inputs:
versionSpec: '5.x'

- task: gitversion/execute@0
displayName: Calculate GitVersion
inputs:
useConfigFile: true
configFilePath: 'GitVersion.yml'

- powershell: |
echo "Current version: $(GitVersion.SemVer)"
displayName: Shows currently compiling version
- task: SonarCloudPrepare@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.Reason'], 'PullRequest'))
inputs:
SonarCloud: 'SonarCloud.UQpy'
organization: 'jhusurg'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'SURGroup_UQpy'
cliProjectName: 'UQpy'
cliSources: '.'
extraProperties: |
sonar.exclusions=**/example/**, **/tests/**, **/docs/**
sonar.python.coverage.reportPaths=./coverage.xml
- script: |
pip install -r requirements.txt
displayName: Install project dependencies
- script: |
pip install pylint
pylint --ignored-modules=numpy,scipy,matplotlib,sklearn --disable=E0202,E1136,E1120,E0401,E0213 --disable=R,C,W src/UQpy
displayName: "Running Pylint"
- script: |
pip install pytest pytest-cov
PYTHONPATH=src pytest --cov=src tests/ --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
# PYTHONPATH=src pytest tests/unit_test/*.py --cov=src tests/ --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Test with pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/ **'

- task: SonarCloudAnalyze@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.Reason'], 'PullRequest'))

- task: SonarCloudPublish@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.Reason'], 'PullRequest'))
inputs:
pollingTimeoutSec: '300'

- script: |
python setup.py $(GitVersion.SemVer) sdist bdist_wheel
displayName: Artifact creation
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- task: CopyFiles@2
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
SourceFolder: 'dist'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'dist'
publishLocation: 'Container'

- script: |
twine upload --repository-url https://upload.pypi.org/legacy/ dist/* --username "$(TESTPYPIU)" --password "$(TESTPYPIP)"
displayName: Upload to PyPi
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- task: GitHubRelease@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
gitHubConnection: 'GitHub_OAuth'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(GitVersion.SemVer)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'

- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')

- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')

- bash: conda create --yes --quiet --name myEnvironment
displayName: Create Anaconda environment
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')

- bash: |
source activate myEnvironment
conda install --yes --quiet --name myEnvironment python=$(pythonVersion) conda-build anaconda-client
displayName: Install Anaconda packages
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- bash: |
source activate myEnvironment
conda build . recipe --variants "{'version': ['$(GitVersion.SemVer)']}"
displayName: Build Noarch conda packages
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- bash: |
source activate myEnvironment
anaconda login --username $(ANACONDAUSER) --password $(ANACONDAPW)
anaconda upload /usr/local/miniconda/envs/myEnvironment/conda-bld/noarch/*.tar.bz2
displayName: Upload conda packages
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
#- job: "Create_Docker_images"
# dependsOn: Build_UQpy_and_run_tests
# pool:
# vmImage: "ubuntu-latest"
# steps:
# - task: gitversion/setup@0
# displayName: Setup GitVersion
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# inputs:
# key: 'python | "$(Agent.OS)" | requirements.txt'
# restoreKeys: |
# python | "$(Agent.OS)"
# python
# path: $(PIP_CACHE_DIR)
# displayName: Cache pip packages

- script: |
pip install -r requirements.txt
displayName: Install project dependencies
- script: |
pip install pylint
pylint --ignored-modules=numpy,scipy,matplotlib,sklearn --disable=E0202,E1136,E1120,E0401 --disable=R,C,W src/UQpy
displayName: "Running Pylint"
- script: |
pip install pytest pytest-cov
PYTHONPATH=src pytest --cov=src tests/ --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
# PYTHONPATH=src pytest tests/unit_test/*.py --cov=src tests/ --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Test with pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/ **'

- task: SonarCloudAnalyze@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.Reason'], 'PullRequest'))

- task: SonarCloudPublish@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.Reason'], 'PullRequest'))
inputs:
pollingTimeoutSec: '300'

- script: |
python setup.py $(GitVersion.SemVer) sdist bdist_wheel
displayName: Artifact creation
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- task: CopyFiles@2
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
SourceFolder: 'dist'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'dist'
publishLocation: 'Container'

- script: |
twine upload --repository-url https://upload.pypi.org/legacy/ dist/* --username "$(TESTPYPIU)" --password "$(TESTPYPIP)"
displayName: Upload to PyPi
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- task: GitHubRelease@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
gitHubConnection: 'GitHub_OAuth'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(GitVersion.SemVer)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'

- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')

- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')

- bash: conda create --yes --quiet --name myEnvironment
displayName: Create Anaconda environment
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')

- bash: |
source activate myEnvironment
conda install --yes --quiet --name myEnvironment python=$(pythonVersion) conda-build anaconda-client
displayName: Install Anaconda packages
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- bash: |
source activate myEnvironment
conda build . recipe --variants "{'version': ['$(GitVersion.SemVer)']}"
displayName: Build Noarch conda packages
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- bash: |
source activate myEnvironment
anaconda login --username $(ANACONDAUSER) --password $(ANACONDAPW)
anaconda upload /usr/local/miniconda/envs/myEnvironment/conda-bld/noarch/*.tar.bz2
displayName: Upload conda packages
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# versionSpec: '5.x'
#
# - task: gitversion/execute@0
# displayName: Calculate GitVersion
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# inputs:
# useConfigFile: true
# configFilePath: 'GitVersion.yml'
#
# - task: Docker@2
# displayName: Login to Dockerhub
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# inputs:
# containerRegistry: 'docker_registry_uqpy'
# command: 'login'
#
# - powershell: |
# echo "Current version: $(GitVersion.SemVer)"
# displayName: Shows currently compiling version
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
#
# - task: Docker@2
# displayName: Build and push packages to Dockerhub
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# inputs:
# containerRegistry: 'docker_registry_uqpy'
# command: 'buildAndPush'
# repository: 'surgroup/uqpy'
# Dockerfile: 'Dockerfile'
# tags: '$(GitVersion.SemVer)'
#
# - task: Docker@2
# displayName: Logout from Dockerhub
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# inputs:
# containerRegistry: 'docker_registry_uqpy'
# command: 'logout'
2 changes: 1 addition & 1 deletion docs/code/RunModel/abaqus_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import time

from UQpy.distributions import Normal, Uniform
from UQpy.run_model.RunModel import *
from UQpy.run_model.RunModel_New import *
from UQpy.sampling import MonteCarloSampling

calling_directory = os.getcwd()
Expand Down
2 changes: 1 addition & 1 deletion docs/code/RunModel/ls_dyna_example_multijob.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# %%
from UQpy.distributions import Uniform
from UQpy.run_model.RunModel import RunModel
from UQpy.run_model.RunModel_New import RunModel_New
from UQpy.sampling import MonteCarloSampling

# %% md
Expand Down
2 changes: 1 addition & 1 deletion docs/code/RunModel/ls_dyna_example_singlejob.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# %%
from UQpy.distributions import Uniform
from UQpy.run_model.RunModel import RunModel
from UQpy.run_model.RunModel_New import RunModel_New
from UQpy.sampling import MonteCarloSampling

# %% md
Expand Down
Loading

0 comments on commit 03143d3

Please sign in to comment.