Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WARNING: Do not edit this file manually.
# Any changes will be overwritten by Copier.
_commit: v0.3.2
_commit: v0.4.2
_src_path: gh:easyscience/templates
app_docs_url: https://easyscience.github.io/shapes-app
app_doi: 10.5281/zenodo.18163581
Expand Down
11 changes: 6 additions & 5 deletions .github/actions/publish-to-pypi/action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: 'Publish to PyPI'
description: 'Publish a built distribution to PyPI using pypa/gh-action-pypi-publish'
description: 'Publish dist/ to PyPI via Trusted Publishing (OIDC)'
inputs:
password:
description: 'PyPI API token (or password) for authentication'
required: true
packages_dir:
description: 'Directory containing the built packages to upload'
required: false
default: 'dist'

runs:
using: 'composite'
steps:
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ inputs.password }}
packages-dir: ${{ inputs.packages_dir }}
56 changes: 25 additions & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,54 @@
repos:
- repo: local
hooks:
# -----------------
# Pre-commit checks
# -----------------
# -------------
# Manual checks
# -------------
- id: pixi-pyproject-check
name: pixi run pyproject-check
entry: pixi run pyproject-check
language: system
pass_filenames: false
stages: [pre-commit]
stages: [manual]

- id: pixi-py-lint-check
name: pixi run py-lint-check-pre STAGED_FILES
entry: pixi run py-lint-check-pre
name: pixi run py-lint-check
entry: pixi run py-lint-check
language: system
pass_filenames: true
files: ^(src/|tests/|docs/docs/tutorials/).*\.py$
stages: [pre-commit]
pass_filenames: false
stages: [manual]

- id: pixi-py-format-check
name: pixi run py-format-check-pre STAGED_FILES
entry: pixi run py-format-check-pre
name: pixi run py-format-check
entry: pixi run py-format-check
language: system
pass_filenames: true
files: ^(src/|tests/|docs/docs/tutorials/).*\.py$
stages: [pre-commit]
pass_filenames: false
stages: [manual]

- id: pixi-nonpy-format-check
name: pixi run nonpy-format-check-pre STAGED_FILES
entry: pixi run nonpy-format-check-pre
name: pixi run nonpy-format-check
entry: pixi run nonpy-format-check
language: system
pass_filenames: true
stages: [pre-commit]
pass_filenames: false
stages: [manual]

- id: pixi-docs-format-check
name: pixi run docs-format-check-pre STAGED_FILES
entry: pixi run docs-format-check-pre
name: pixi run docs-format-check
entry: pixi run docs-format-check
language: system
pass_filenames: true
files: ^(src/|docs/docs/tutorials/).*\.py$
stages: [pre-commit]
pass_filenames: false
stages: [manual]

# ----------------
# Pre-push checks
# ----------------
- id: pixi-nonpy-format-check
name: pixi run nonpy-format-check
entry: pixi run nonpy-format-check
- id: pixi-notebook-format-check
name: pixi run notebook-format-check
entry: pixi run notebook-format-check
language: system
pass_filenames: false
stages: [pre-push]
stages: [manual]

- id: pixi-unit-tests
name: pixi run unit-tests
entry: pixi run unit-tests
language: system
pass_filenames: false
stages: [pre-push]
stages: [manual]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

**EasyShapes** is a scientific software for generation of ordered
molecular aggregates and pre-assembled composite structures to seed
molecular dynamics (md) simulations aimed at studying equilibration
molecular dynamics (MD) simulations aimed at studying equilibration
(relaxation) processes in soft matter and biomolecular systems..

<!-- HOME REPOSITORY SECTION -->
Expand Down
2 changes: 1 addition & 1 deletion pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 3 additions & 21 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,7 @@ py-format-check = "ruff format --check src/ tests/ docs/docs/tutorials/"
nonpy-format-check = "npx prettier --list-different --config=prettierrc.toml --ignore-unknown ."
nonpy-format-check-modified = "python tools/nonpy_prettier_modified.py"

check = { depends-on = [
'py-format-check',
'docs-format-check',
'py-lint-check',
'nonpy-format-check-modified',
] }
check = 'pre-commit run --hook-stage manual --all-files'

##########
# 🛠️ Fixes
Expand All @@ -119,7 +114,7 @@ fix = { depends-on = [
'py-format-fix',
'docs-format-fix',
'py-lint-fix',
'nonpy-format-fix-modified',
'nonpy-format-fix',
'success-message-fix',
] }

Expand Down Expand Up @@ -191,19 +186,6 @@ copier-update = "copier update --data-file ../shapes/.copier-answers.yml --data
# 🪝 Pre-commit Hooks
#####################

# Pre-commit hook commands (to be used in .pre-commit-config.yaml)
py-lint-check-pre = 'ruff check'
py-format-check-pre = "ruff format --check"
nonpy-format-check-pre = "npx prettier --list-different --config=prettierrc.toml --ignore-unknown"
docs-format-check-pre = 'docformatter --check'

# Run like a real commit: staged files only (almost)
pre-commit-check = 'pre-commit run --hook-stage pre-commit'
# CI check: lint/format everything
pre-commit-check-all = 'pre-commit run --all-files --hook-stage pre-commit'
# Pre-push check: lint/format everything
pre-push-check = 'pre-commit run --all-files --hook-stage pre-push'

pre-commit-clean = 'pre-commit clean'
pre-commit-install = 'pre-commit install --hook-type pre-commit --hook-type pre-push --overwrite'
pre-commit-uninstall = 'pre-commit uninstall --hook-type pre-commit --hook-type pre-push'
Expand Down Expand Up @@ -232,7 +214,7 @@ spdx-update = 'python tools/update_spdx.py'
post-install = { depends-on = [
'npm-config',
'prettier-install',
'pre-commit-setup',
#'pre-commit-setup',
] }

##########################
Expand Down
19 changes: 19 additions & 0 deletions src/easyshapes_app/Backends/MockBackend.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-FileCopyrightText: 2024 EasyApp contributors
// SPDX-License-Identifier: BSD-3-Clause
// © 2024 Contributors to the EasyApp project <https://github.com/easyscience/EasyApp>

pragma Singleton

import QtQuick

import Backends.MockQml as MockLogic


QtObject {

property var project: MockLogic.Project
property var analysis: MockLogic.Analysis
property var status: MockLogic.Status
property var report: MockLogic.Report

}
74 changes: 74 additions & 0 deletions src/easyshapes_app/Backends/MockQml/Analysis
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// SPDX-FileCopyrightText: 2024 EasyApp contributors
// SPDX-License-Identifier: BSD-3-Clause
// © 2024 Contributors to the EasyApp project <https://github.com/easyscience/EasyApp>

pragma Singleton

import QtQuick

QtObject {

property bool created: false

property string name: ''

readonly property var info: {
'description': '',
'location': '',
'creationDate': ''
}

readonly property var examples: [
{
'description': 'neutrons, powder, constant wavelength, HRPT@PSI',
'name': 'La0.5Ba0.5CoO3 (HRPT)',
'path': ':/Examples/La0.5Ba0.5CoO3_HRPT@PSI/project.cif'
},
{
'description': 'neutrons, powder, constant wavelength, HRPT@PSI',
'name': 'La0.5Ba0.5CoO3-Raw (HRPT)',
'path': ':/Examples/La0.5Ba0.5CoO3-Raw_HRPT@PSI/project.cif'
},
{
'description': 'neutrons, powder, constant wavelength, HRPT@PSI, 2 phases',
'name': 'La0.5Ba0.5CoO3-Mult-Phases (HRPT)',
'path': ':/Examples/La0.5Ba0.5CoO3-Mult-Phases_HRPT@PSI/project.cif'
},
{
'description': 'neutrons, powder, constant wavelength, D20@ILL',
'name': 'Co2SiO4 (D20)',
'path': ':/Examples/Co2SiO4_D20@ILL/project.cif'
},
{
'description': 'neutrons, powder, constant wavelength, G41@LLB',
'name': 'Dy3Al5O12 (G41)',
'path': ':/Examples/Dy3Al5O12_G41@LLB/project.cif'
},
{
'description': 'neutrons, powder, constant wavelength, D1A@ILL',
'name': 'PbSO4 (D1A)',
'path': ':/Examples/PbSO4_D1A@ILL/project.cif'
},
{
'description': 'neutrons, powder, constant wavelength, 3T2@LLB',
'name': 'LaMnO3 (3T2)',
'path': ':/Examples/LaMnO3_3T2@LLB/project.cif'
}
]

function create() {
console.debug(`Creating project '${name}'`)
info.creationDate = `${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`
infoChanged() // this signal is not emitted automatically when only part of the object is changed
created = true
}

function save() {
console.debug(`NOT IMPLEMENTED: Saving project '${name}'`)
}

function editInfo(path, new_value) {
console.debug(`NOT IMPLEMENTED: Changing project info.${path} from '${info.path}' to '${new_value}'`)
}

}
47 changes: 47 additions & 0 deletions src/easyshapes_app/Backends/MockQml/Analysis.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-FileCopyrightText: 2024 EasyApp contributors
// SPDX-License-Identifier: BSD-3-Clause
// © 2024 Contributors to the EasyApp project <https://github.com/easyscience/EasyApp>

pragma Singleton

import QtQuick
import QtGraphs

import Gui.Globals as Globals


QtObject {

property int dataSize: 50
property var axesRanges: {
"xmin": 0.0,
"xmax": 180.0,
"ymin": 0.0,
"ymax": 100.0,
}

signal dataPointsChanged(var points)

function generateData() {
console.debug(`* Generating ${dataSize} data points...`)
const xmin = axesRanges.xmin
const xmax = axesRanges.xmax
const ymin = axesRanges.ymin
const ymax = axesRanges.ymax

const stepSize = (xmax - xmin) / (dataSize - 1)

let dataPoints = []
for (let i = 0; i < dataSize + 1; i++) {
const x = i * stepSize
const y = ymin + Math.random() * (ymax - ymin)
dataPoints.push(Qt.point(x, y))
}
console.debug(" Data generation completed.")

console.debug(`* Sending ${dataSize} data points to series...`)
dataPointsChanged(dataPoints)
console.debug(" Data update signal emitted.")
}

}
Loading
Loading