Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade parser and bump version v4.0.0 #41

Merged
merged 2 commits into from
Jul 13, 2024
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
10 changes: 10 additions & 0 deletions caelus/io/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,19 @@ def p_dim_value(self, p):
| identifier dimension vector
| identifier dimension symm_tensor
| identifier dimension tensor
| identifier dimension MACRO_VAR
"""
p[0] = dtypes.DimValue(p[1], p[2], p[3])

def p_dim_value_nokey(self, p):
""" dim_value : dimension number
| dimension vector
| dimension symm_tensor
| dimension tensor
| dimension MACRO_VAR
"""
p[0] = dtypes.DimValue("", p[1], p[2])

def p_dimension(self, p):
""" dimension : LBRACKET INT_CONST INT_CONST INT_CONST INT_CONST INT_CONST INT_CONST INT_CONST RBRACKET
| LBRACKET INT_CONST INT_CONST INT_CONST INT_CONST INT_CONST RBRACKET
Expand Down
2 changes: 1 addition & 1 deletion caelus/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import shlex
import subprocess

_basic_version = "v3.0.0"
_basic_version = "v4.0.0"


def git_describe():
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
# built documents.
#
# The short X.Y version.
version = u'v3.0.0'
version = u'v4.0.0'
# The full version, including alpha/beta/rc tags.
release = u'v3.0.0'
release = u'v4.0.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -137,7 +137,7 @@

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#html_title = u'Caelus Python v3.0.0'
#html_title = u'Caelus Python v4.0.0'

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
Expand Down
2 changes: 1 addition & 1 deletion etc/conda/caelus/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package:
name: caelus
version: "v3.0.0"
version: "v4.0.0"

source:
git_rev: main
Expand Down
2 changes: 1 addition & 1 deletion etc/conda/conda-pkg.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ REM ### Create a Conda package for Caelus Python Library
REM # Run from the script directory
cd "%~dp0" || exit /B 1

set caelus_version="v3.0.0"
set caelus_version="v4.0.0"
set script_dir="%~dp0"

REM Activate base/root environment for build and constructor
Expand Down
2 changes: 1 addition & 1 deletion etc/conda/conda-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
# Run from the script directory
cd ${0%/*} || exit 1

caelus_version="v3.0.0"
caelus_version="v4.0.0"
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Set up conda environment
Expand Down
2 changes: 1 addition & 1 deletion etc/conda/installer/construct-template.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Custom conda installer for Caelus Python Library

name: caelus-conda
version: v3.0.0
version: v4.0.0

install_in_dependency_order: True

Expand Down
2 changes: 1 addition & 1 deletion etc/misc/bump-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ FILES=(setup.py
)

for fname in ${FILES[@]} ; do
sed -i '' -e 's/2.0.0/3.0.0/' ${fname}
sed -i '' -e 's/3.0.0/4.0.0/' ${fname}
done
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from setuptools import setup, find_packages

VERSION = "3.0.0"
VERSION = "4.0.0"

classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -26,7 +26,7 @@


setup(
name="caelus",
name="py-caelus",
version=VERSION,
url="https://sayerhs.github.io/cpl/",
license="Apache License, Version 2.0",
Expand Down Expand Up @@ -57,7 +57,6 @@
""",
python_requires='>=3.10',
install_requires=[
"pip",
"six>=1.16.0",
"numpy>=1.26.0",
"scipy>=1.11.0",
Expand Down
10 changes: 10 additions & 0 deletions tests/io/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,16 @@ def test_dimension_str(cparse):
out = cparse.parse(text)
assert(isinstance(out.kappa.dims, dtypes.DimStr))

def test_dimension_nokey(cparse):
"""Test dimension entry without an identifier key"""
text = """
rho [1 -3 0 0 0] $rho_input;
"""
out = cparse.parse(text)
assert isinstance(out.rho, dtypes.DimValue)
assert out.rho.name == ""
assert out.rho.value.startswith("$")

def test_arrays(cparse):
text = """
vertices
Expand Down
Loading