Skip to content

Commit

Permalink
Make ExNode iterators skip hidden nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasper Peeters committed Nov 13, 2023
1 parent 49299e9 commit ad85a64
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(CADABRA_VERSION_MAJOR 2)
set(CADABRA_VERSION_MINOR 4)
set(CADABRA_VERSION_PATCH 4)
set(CADABRA_VERSION_TWEAK 1)
set(CADABRA_VERSION_PATCH 5)
set(CADABRA_VERSION_TWEAK 0)
set(COPYRIGHT_YEARS "2001-2023")
math(EXPR SYSTEM_BITS "${CMAKE_SIZEOF_VOID_P} * 8")
find_program(GIT git PATHS ${GIT_DIR})
Expand Down
2 changes: 1 addition & 1 deletion config/install_script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Cadabra2"
#define MyAppVersion "2.4.4"
#define MyAppVersion "2.4.5"
#define MyAppPublisher "Kasper Peeters"
#define MyAppURL "https://www.cadabra.science/"
#define MyAppExeName "cadabra2-gtk.exe"
Expand Down
9 changes: 7 additions & 2 deletions core/ExNode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,13 @@ void ExNode::update(bool first)
#ifdef DEBUG
std::cerr << "update at " << nxtit << std::endl;
#endif
if(tag=="" || *nxtit->name==tag)
return;
if(*nxtit->name=="\\ldots") {
nxtit.skip_children();
}
else {
if(tag=="" || *nxtit->name==tag)
return;
}
++nxtit;
}
}
Expand Down
20 changes: 17 additions & 3 deletions tests/selecting.cdb
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,24 @@ def test08():
print("Test 08c passed")

test08()


#def test08():

def test09():
def doit(ex):
for nabla in ex[r'\nabla']:
nabla.name = r'\partial'
return ex

ex:= \nabla{A} + \nabla{B};
zoom(ex, $\nabla{A}$)
doit(_)
unzoom(ex)
tst:= \partial{A} + \nabla{B} - @(ex);
assert(tst==0)
print("Test 09 passed")

test09()

#def test08():
#
# \epsilon::Weight(label=field, value=1);
# Exp:=\epsilon**4+\epsilon*(\epsilon**3+5);
Expand Down
10 changes: 8 additions & 2 deletions web2/cadabra2/source/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ <h1>Change log</h1>
development, even numbered ones are released in packaged form.
</p>
<a name="master"></a>
<h3>github master (2.4.3)</h3>
<h3>github master (2.4.5)</h3>
<ul>
<li>Fix simplification of <tt>pow</tt> nodes.</li>
<li>Make <tt>ExNode</tt> iterators skip nodes hidden by <tt>zoom</tt></li>
</ul>

<h3>2.4.4 (released 20-Sep-2023)</h3>
<ul>
<li>Fix canonicalisation of rationals.</li>
<li>Make <tt>expand_power</tt> work on zero and negative
powers.</li>
<li>Prevent dummy indices from leaking out of <tt>\pow</tt> nodes.</li>
</ul>

<h3>github master (2.4.2)</h3>
<h3>2.4.2 (released 22-Oct-2022)</h3>
<ul>
<li>Add missing trig functions for display and passthrough to sympy (Oscar).</li>
<li>Allow for index values to be specified as an integer range.</li>
Expand Down

0 comments on commit ad85a64

Please sign in to comment.