From a8f25d14cdda2f4bf196b04107052f9e0d547cf8 Mon Sep 17 00:00:00 2001 From: HarshaRani Date: Sun, 19 Jun 2022 14:00:07 +0530 Subject: [PATCH 1/4] Update setup.py changed the version number from 3.2 to 3.3 and vpython was added --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e4c9babd85..a51bb62875 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ numCores_ = multiprocessing.cpu_count() -version_ = '3.3.0.dev%s' % stamp +version_ = '4.0.0.dev%s' % stamp # importlib is available only for python3. Since we build wheels, prefer .so # extension. This way a wheel built by any python3.x will work with any python3. From a3ddaf3c3857a616ac040b57917f4e472ad99d2c Mon Sep 17 00:00:00 2001 From: Anal Kumar Date: Fri, 24 Jun 2022 15:45:09 +0530 Subject: [PATCH 2/4] removed parse and symbol modules --- python/moose/utils.py | 45 ------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/python/moose/utils.py b/python/moose/utils.py index f5d4fad362..37c99bf4d7 100644 --- a/python/moose/utils.py +++ b/python/moose/utils.py @@ -6,9 +6,7 @@ from __future__ import absolute_import import types -import parser import token -import symbol import math from datetime import datetime from collections import defaultdict @@ -225,49 +223,6 @@ def apply_to_tree(moose_wildcard, python_filter=None, value=None): ) -def tweak_field(moose_wildcard, field, assignment_string): - """Tweak a specified field of all objects that match the - moose_wildcard using assignment string. All identifiers in - assignment string must be fields of the target object. - - Example: - - tweak_field('/mycell/##[Class=Compartment]', 'Rm', '1.5 / (3.1416 * diameter * length') - - will assign Rm to every compartment in mycell such that the - specific membrane resistance is 1.5 Ohm-m2. - """ - if not isinstance(moose_wildcard, str): - raise TypeError("moose_wildcard must be a string.") - id_list = moose.getWildcardList(moose_wildcard, True) - expression = parser.expr(assignment_string) - expr_list = expression.tolist() - # This is a hack: I just tried out some possible syntax trees and - # hand coded the replacement such that any identifier is replaced - # by moose_obj.identifier - def replace_fields_with_value(x): - if len(x) > 1: - if ( - x[0] == symbol.power - and x[1][0] == symbol.atom - and x[1][1][0] == token.NAME - ): - field = x[1][1][1] - x[1] = [symbol.atom, [token.NAME, "moose_obj"]] - x.append([symbol.trailer, [token.DOT, "."], [token.NAME, field]]) - for item in x: - if isinstance(item, list): - replace_fields_with_value(item) - return x - - tmp = replace_fields_with_value(expr_list) - new_expr = parser.sequence2st(tmp) - code = new_expr.compile() - for moose_id in id_list: - moose_obj = eval("moose.%s(moose_id)" % (moose.Neutral(moose_id).className)) - value = eval(code) - moose.setField(moose_id, field, str(value)) - # 2012-01-11 19:20:39 (+0530) Subha: checked for compatibility with dh_branch def printtree(root, vchar="|", hchar="__", vcount=1, depth=0, prefix="", is_last=False): From 06d627a7c127784f0b28061da2952d0288d1e279 Mon Sep 17 00:00:00 2001 From: Anal Kumar Date: Fri, 24 Jun 2022 16:35:29 +0530 Subject: [PATCH 3/4] Update pymoose.yml added 3.9 and 3.10 --- .github/workflows/pymoose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pymoose.yml b/.github/workflows/pymoose.yml index fd29bb9bf2..3402f90ef3 100644 --- a/.github/workflows/pymoose.yml +++ b/.github/workflows/pymoose.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8] + python-version: [3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v2 From 619445447a8df3ad685062c7edf76f71a7affe32 Mon Sep 17 00:00:00 2001 From: Anal Kumar Date: Fri, 24 Jun 2022 16:38:26 +0530 Subject: [PATCH 4/4] Update pymoose.yml --- .github/workflows/pymoose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pymoose.yml b/.github/workflows/pymoose.yml index 3402f90ef3..937e2bffe8 100644 --- a/.github/workflows/pymoose.yml +++ b/.github/workflows/pymoose.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, 3.10] + python-version: [3.7, 3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v2