Skip to content

Commit 54c3ba4

Browse files
authored
Merge pull request #2 from kpeeters/master
Sync with upstream
2 parents d8125da + 9421e10 commit 54c3ba4

File tree

7 files changed

+62
-28
lines changed

7 files changed

+62
-28
lines changed

client_server/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,6 @@ if(NOT MSVC)
272272
FILES
273273
../man/man1/cadabra-server.1
274274
DESTINATION
275-
man/man1
275+
share/man/man1
276276
)
277277
endif()

core/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,14 @@ if (MSVC AND NOT INSTALL_TARGETS_ONLY)
420420
install_dlls_from("core")
421421
endif()
422422

423+
add_custom_target(deduplicate
424+
COMMAND rm -f "\$(DESTDIR)${CMAKE_INSTALL_PREFIX}/man/man1/cadabra2.1"
425+
COMMAND rm -f "\$(DESTDIR)${CMAKE_INSTALL_PREFIX}/man/man1/cadabra2cadabra.1"
426+
COMMAND rm -f "\$(DESTDIR)${CMAKE_INSTALL_PREFIX}/man/man1/cadabra2html.1"
427+
COMMAND rm -f "\$(DESTDIR)${CMAKE_INSTALL_PREFIX}/man/man1/cadabra2python.1"
428+
COMMAND rm -f "\$(DESTDIR)${CMAKE_INSTALL_PREFIX}/man/man1/cadabra2-gtk.1"
429+
COMMAND rm -f "\$(DESTDIR)${CMAKE_INSTALL_PREFIX}/man/man1/cadabra-server.1")
430+
423431
# manual pages
424432
if(NOT MSVC)
425433
install(
@@ -429,6 +437,6 @@ if(NOT MSVC)
429437
../man/man1/cadabra2html.1
430438
../man/man1/cadabra2python.1
431439
DESTINATION
432-
man/man1
440+
share/man/man1
433441
)
434442
endif()

core/cadabra2_defaults.py.in

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import cadabra2
1313
from cadabra2 import *
1414
from importlib.machinery import PathFinder, ModuleSpec, SourceFileLoader
1515
from importlib.abc import MetaPathFinder
16-
from cdb_appdirs import user_config_dir
16+
from cdb_appdirs import user_config_dir, user_data_dir
1717
import datetime
18+
import atexit
1819

1920
__cdbkernel__=cadabra2.__cdbkernel__
2021
import os
@@ -160,6 +161,22 @@ try:
160161
except ImportError:
161162
have_matplotlib=False
162163

164+
def save_history(history_path):
165+
try:
166+
readline.write_history_file(history_path)
167+
except:
168+
pass
169+
170+
try:
171+
import readline
172+
history_path = os.path.join(user_data_dir(), "cadabra_history")
173+
if os.path.exists(history_path):
174+
readline.read_history_file(history_path)
175+
readline.set_history_length(1000)
176+
atexit.register(save_history, history_path)
177+
except:
178+
pass
179+
163180
import io
164181
import base64
165182

core/properties/PartialDerivative.cnb

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"cell_id" : 17591436373968656652,
2+
"cell_id" : 5894066773150673170,
33
"cells" :
44
[
55
{
@@ -95,6 +95,15 @@
9595
"cell_id" : 9223372036854775820,
9696
"cell_origin" : "server",
9797
"cell_type" : "input_form",
98+
"cells" :
99+
[
100+
{
101+
"cell_id" : 9223372036854775821,
102+
"cell_origin" : "server",
103+
"cell_type" : "input_form",
104+
"source" : "\\partial(f g)"
105+
}
106+
],
98107
"source" : "D(c d e)"
99108
}
100109
],
@@ -120,6 +129,12 @@
120129
"cell_origin" : "server",
121130
"cell_type" : "input_form",
122131
"source" : "D(c) d e + c D(d) e + c d D(e)"
132+
},
133+
{
134+
"cell_id" : 9223372036854775823,
135+
"cell_origin" : "server",
136+
"cell_type" : "input_form",
137+
"source" : "g \\partial(f)"
123138
}
124139
],
125140
"source" : "\\begin{dmath*}{}D{c} d e+c D{d} e+c d D{e}\\end{dmath*}"
@@ -166,51 +181,33 @@
166181
"cells" :
167182
[
168183
{
169-
"cell_id" : 9223372036854775809,
184+
"cell_id" : 9223372036854775817,
170185
"cell_origin" : "server",
171186
"cell_type" : "latex_view",
172187
"source" : "\\begin{dmath*}{}\\text{Attached property Coordinate to~}\\tau.\\end{dmath*}"
173188
},
174189
{
175-
"cell_id" : 9223372036854775810,
190+
"cell_id" : 9223372036854775818,
176191
"cell_origin" : "server",
177192
"cell_type" : "latex_view",
178193
"source" : "\\begin{dmath*}{}\\text{Attached property Derivative to~}\\partial{\\#}.\\end{dmath*}"
179194
},
180195
{
181-
"cell_id" : 9223372036854775811,
196+
"cell_id" : 9223372036854775819,
182197
"cell_origin" : "server",
183198
"cell_type" : "latex_view",
184199
"source" : "\\begin{dmath*}{}\\text{Attached property Depends to~}f.\\end{dmath*}"
185200
},
186201
{
187-
"cell_id" : 9223372036854775812,
202+
"cell_id" : 9223372036854775820,
188203
"cell_origin" : "server",
189204
"cell_type" : "latex_view",
190-
"cells" :
191-
[
192-
{
193-
"cell_id" : 9223372036854775813,
194-
"cell_origin" : "server",
195-
"cell_type" : "input_form",
196-
"source" : "\\partial(f g)"
197-
}
198-
],
199205
"source" : "\\begin{dmath*}{}\\partial\\left(f g\\right)\\end{dmath*}"
200206
},
201207
{
202-
"cell_id" : 9223372036854775814,
208+
"cell_id" : 9223372036854775822,
203209
"cell_origin" : "server",
204210
"cell_type" : "latex_view",
205-
"cells" :
206-
[
207-
{
208-
"cell_id" : 9223372036854775815,
209-
"cell_origin" : "server",
210-
"cell_type" : "input_form",
211-
"source" : "g \\partial(f)"
212-
}
213-
],
214211
"source" : "\\begin{dmath*}{}g \\partial{f}\\end{dmath*}"
215212
}
216213
],

frontend/gtkmm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,6 @@ if(NOT MSVC)
196196
FILES
197197
../../man/man1/cadabra2-gtk.1
198198
DESTINATION
199-
man/man1
199+
share/man/man1
200200
)
201201
endif()

libs/pybind11/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ if(NOT (CMAKE_VERSION VERSION_LESS 3.0)) # CMake >= 3.0
119119
target_link_libraries(embed INTERFACE pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)
120120
endif()
121121

122+
if (NOT PYBIND_MASTER_PROJECT)
123+
install(
124+
CODE
125+
"
126+
if (EXISTS \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/man/man1/cadabra2.1\")
127+
message(FATAL_ERROR \"The location of the Cadabra manual has changed since the last installation. Please remove the old files with make deduplicate.\")
128+
endif()
129+
"
130+
)
131+
endif()
132+
122133
if (PYBIND11_INSTALL)
123134
install(DIRECTORY ${PYBIND11_INCLUDE_DIR}/pybind11 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
124135
# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".

web2/cadabra2/source/changelog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ <h1>Change log</h1>
1818
<a name="master"></a>
1919
<h3>github master</h3>
2020
<ul>
21+
<li>Save command-line history (Connor).</li>
2122
<li>Make imported notebooks use the default <tt>post_process</t> function.</li>
2223
<li>Make <tt>unwrap</tt> move scalars out of exterior (wedge)
2324
products, see <a href="https://cadabra.science/qa/1287/collecting-scalar-terms-expressions-with-differentialforms">this

0 commit comments

Comments
 (0)