Skip to content

Commit

Permalink
Fix for coe-q
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrolexa committed Dec 13, 2024
1 parent d18184f commit 61b3716
Show file tree
Hide file tree
Showing 11 changed files with 1,302 additions and 53 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/master.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python testing

on:
push:
branches:
- '**'
pull_request:

jobs:
build:
name: Testing on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# setuptools_scm requires a non-shallow clone of the repository
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Python package
run: |
python -m pip install pytest
python -m pip install .
- name: Run Python tests
run: |
python -m pytest
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Changelog
All notable pypsbuilder changes.

## [2.5.0] - 2024-12-13
### Fixed
- fix for coe-q

## [2.4.2] - 2024-04-23
### Fixed
- another fix of and-ky-sill triple point linking

## [2.4.1] - 2024-03-07
### Fixed
- fixed and-ky-sill triple point uniline suggestions
Expand Down Expand Up @@ -59,7 +64,7 @@ All notable pypsbuilder changes.
- latest THERMOCALC 3.50 compatibility

### Added
- isopleths quadratic surface fit method added
- isopleths quadratic surface fit method added
- isopleths figure and savefig options added

## [2.2.2] - 2021-01-25
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
# built documents.
#
# The short X.Y version.
version = "2.4"
version = "2.5"
# The full version, including alpha/beta/rc tags.
release = "2.4.2"
release = "2.5.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1,177 changes: 1,177 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[tool.poetry]
name = "pypsbuilder"
version = "2.5.0"
description = "THERMOCALC front-end for constructing and analyzing PT pseudosections"
authors = ["Ondrej Lexa <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"
numpy = "^1.20"
matplotlib = "^3.6"
pyqt5 = "^5.15"
scipy = "^1.10"
networkx = "^3.2"
shapely = "^2.0"
tqdm = "^4.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.4"
black = "^24"

[tool.poetry.scripts]
ptbuilder = "pypsbuilder.psbuilders:ptbuilder"
txbuilder = "pypsbuilder.psbuilders:txbuilder"
pxbuilder = "pypsbuilder.psbuilders:pxbuilder"
psshow = "pypsbuilder.psexplorer:ps_show"
psiso = "pypsbuilder.psexplorer:ps_iso"
psgrid = "pypsbuilder.psexplorer:ps_grid"
psdrawpd = "pypsbuilder.psexplorer:ps_drawpd"
tcinit = "pypsbuilder.tcinit:tcprojinit"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
/(
\.toml
|\.sh
|\.git
|\.ini
)/
'''

[[tool.poetry.source]]
name = "pypi-public"
url = "https://pypi.org/simple/"
4 changes: 2 additions & 2 deletions pypsbuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"get_tcapi",
)

__version__ = "2.4.2"
__version__ = "2.5.0"
__author__ = "Ondrej Lexa"
__copyright__ = "© Ondrej Lexa 2024"
__copyright__ = "© Ondrej Lexa 2016-2024"
__email__ = "[email protected]"
6 changes: 3 additions & 3 deletions pypsbuilder/psbuilders.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from datetime import datetime
import itertools

from pkg_resources import resource_filename
import importlib.resources as ires
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QT_VERSION_STR
from PyQt5.Qt import PYQT_VERSION_STR
Expand Down Expand Up @@ -94,7 +94,7 @@ def __init__(self, parent=None):
res = QtWidgets.QDesktopWidget().screenGeometry()
self.resize(min(1280, res.width() - 10), min(720, res.height() - 10))
self.setWindowTitle(self.builder_name)
window_icon = resource_filename("pypsbuilder", app_icons[self.builder_name])
window_icon = str(ires.files("pypsbuilder").joinpath(app_icons[self.builder_name]))
self.setWindowIcon(QtGui.QIcon(window_icon))
self.__changed = False
self.about_dialog = AboutDialog(self.builder_name, __version__, __copyright__)
Expand Down Expand Up @@ -5097,7 +5097,7 @@ class TopologyGraph(QtWidgets.QDialog):
def __init__(self, ps, parent=None):
super(TopologyGraph, self).__init__(parent)
self.setWindowTitle("Topology graph")
window_icon = resource_filename("pypsbuilder", "images/pypsbuilder.png")
window_icon = str(ires.files("pypsbuilder").joinpath("images/pypsbuilder.png"))
self.setWindowIcon(QtGui.QIcon(window_icon))
self.setWindowFlags(
QtCore.Qt.WindowMinMaxButtonsHint | QtCore.Qt.WindowCloseButtonHint
Expand Down
26 changes: 20 additions & 6 deletions pypsbuilder/psclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
outputs and storage of calculated invariant points and univariant lines.
"""

# author: Ondrej Lexa
# website: https://github.com/ondrolexa/pypsbuilder

Expand Down Expand Up @@ -473,9 +474,11 @@ def from_block(cls, block, ptguess):
phases = head.split()[1:]
# fixed width parsing !!!
valsf = [
float(vals[6:][12 * i : 12 * (i + 1)].strip())
if vals[6:][12 * i : 12 * (i + 1)].strip() != ""
else 0.0
(
float(vals[6:][12 * i : 12 * (i + 1)].strip())
if vals[6:][12 * i : 12 * (i + 1)].strip() != ""
else 0.0
)
for i in range(len(phases))
]
for phase, val in zip(phases, valsf):
Expand All @@ -484,9 +487,11 @@ def from_block(cls, block, ptguess):
head, vals = factor.split("\n")
phases = head.split()[1:]
valsf = [
float(vals[6:][12 * i : 12 * (i + 1)].strip())
if vals[6:][12 * i : 12 * (i + 1)].strip() != ""
else 0.0
(
float(vals[6:][12 * i : 12 * (i + 1)].strip())
if vals[6:][12 * i : 12 * (i + 1)].strip() != ""
else 0.0
)
for i in range(len(phases))
]
for phase, val in zip(phases, valsf):
Expand Down Expand Up @@ -868,6 +873,8 @@ def splitme(edges):
unilist.append(uni_id)
if unilist:
phases = set.intersection(*(self.unilines[id].phases for id in unilist))
print(phases, unilist)
print("---")
vd = [
phases.symmetric_difference(self.unilines[id].phases)
== self.unilines[id].out
Expand Down Expand Up @@ -934,6 +941,13 @@ def splitme(edges):
phases = self.unilines[unilist[0]].phases.difference(
self.unilines[unilist[0]].out
)
if frozenset(phases) in shapes: # switch polymorph
for pp in polymorphs:
if self.unilines[unilist[0]].out.issubset(pp):
phases = self.unilines[unilist[0]].phases.difference(
pp.difference(self.unilines[unilist[0]].out)
)
break
shapes[frozenset(phases)] = poly
unilists[frozenset(phases)] = unilist
elif frozenset(phases) in shapes:
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[bumpversion]
current_version = 2.4.2
current_version = 2.5.0
commit = True
tag = True
tag_name = {new_version}

[bumpversion:file:setup.py]

[bumpversion:file:pyproject.toml]

[bumpversion:file:docs/conf.py]

[bumpversion:file:pypsbuilder/__init__.py]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

setup(
name="pypsbuilder",
version="2.4.2",
version="2.5.0",
description="THERMOCALC front-end for constructing and analyzing PT pseudosections",
long_description=readme + "\n\n" + changelog,
long_description_content_type="text/markdown",
author="Ondrej Lexa",
author_email="[email protected]",
url="https://github.com/ondrolexa/pypsbuilder",
license="MIT",
python_requires=">=3.8",
python_requires=">=3.9",
packages=find_packages(),
package_data={"pypsbuilder.images": ["*.png"]},
entry_points="""
Expand Down

0 comments on commit 61b3716

Please sign in to comment.