diff -Nru gyoto-1.4.3/ChangeLog gyoto-1.4.4/ChangeLog --- gyoto-1.4.3/ChangeLog 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/ChangeLog 2020-02-28 19:19:43.000000000 +0000 @@ -1,6 +1,161 @@ commit unknown Author: Thibaut Paumard -Date: Tue Oct 25 16:57:04 2019 +0200 +Date: Fri Feb 28 18:40:08 2020 +0100 + + Releasing 1.4.4 + +commit 8042b896850ed0e28d56101d0c574bd530b3bbb9 +Author: Thibaut Paumard +Date: Fri Feb 28 14:03:20 2020 +0100 + + Fix typo refered -> referred + + (cherry picked from commit 034ca81045cd4c1c07a1fab649f0ec52508fca4b) + +commit 68b22662b0188f8cd882180438006a1052276313 +Author: Thibaut Paumard +Date: Thu Feb 27 14:09:39 2020 +0100 + + Python: rework refernce counting issues + + Add test suite for reference counting, modify interface to fix issues + + (cherry picked from commit ec066ab7ba73a88e5fcd0165abf127f9170ee1c3) + +commit a81fed23d0e2eb6adc2d78623c06652b481a5aac +Author: Thibaut Paumard +Date: Thu Feb 27 13:31:53 2020 +0100 + + Python: add gyoto.spectrometer.Uniform = gyoto.spectrometer.UniformSpectrometer + + (cherry picked from commit 6530372e2cef1261ae32d70dbf06a5131db4b5c0) + +commit 03e9aff1c4dc12f25ad0b649a01eb78c0c9aee15 +Author: Thibaut Paumard +Date: Thu Feb 27 13:10:01 2020 +0100 + + Fix classes so cloning always works + + Some classes where expecting to be somehow initialized. + Cloning/printing should always work. + Turn some errors into severe warnings. + + (cherry picked from commit 0c3183059db190e0c67057c71e71d0d44d9a5ec7) + +commit 0c33673c9d7d6106ed0f0444316c7fbb6f582632 +Author: Frederic Vincent +Date: Mon Feb 24 14:32:37 2020 +0100 + + Scenery: correct small typo in print in destructor + + (cherry picked from commit 95204b829f0628f99550e5363f15f8928400bd3c) + +commit 3c3084ed67e37b62690abc983e55bb6ec0109735 +Author: Thibaut Paumard +Date: Tue Feb 18 20:09:09 2020 +0100 + + Factory.C: print Screen section only once + + (cherry picked from commit 7c46c94d8c26ba0c577587cb37c510d6899167f2) + +commit f7ce04b1000032b91aeecb760edcf82622e099e9 +Author: Frederic Vincent +Date: Thu Feb 13 14:03:15 2020 +0100 + + PolishDoughnut: put default bremsstrahlung_ to False + + (cherry picked from commit a4bd341888388e167eb92116c2419c5a33312e9e) + +commit 542208a412c72bf37343178224c893d7ca698c8a +Author: Frederic Vincent +Date: Wed Feb 5 16:39:19 2020 +0100 + + KerrBL: replace christoffels by exactly equivalent expressions, easier to read, tested with SageMath + + (cherry picked from commit 6cad755646222a729ba9446813d2dd7e37de7479) + +commit bbdbb5abcfe76c7e4941babcc837d5b0da1a0a6b +Author: Frederic Vincent +Date: Wed Feb 5 16:24:23 2020 +0100 + + ThickDisk: bug in radial velocity below ISCO corrected + + (cherry picked from commit 4a58ba6a77d5b2a703cfe7c96a697ca9e635c249) + +commit fd48e486da4f560f130b06fb37942a4bc6c55956 +Author: Thibaut Paumard +Date: Tue Feb 4 16:05:51 2020 +0100 + + Always use C locale when writing doubles to XML + + (cherry picked from commit abb343d1e0719329257ca1620d6c276cfa954075) + +commit 6bfeedf07d04e14b4061a474b8bb4c153bec63d1 +Author: Thibaut Paumard +Date: Tue Feb 4 15:20:23 2020 +0100 + + Set LC_NUMERIC to 'C' before calling std::atof + + Gyoto always assumes that decimal_point is '.' and ignore whatever the locale + says. We always set LC_NUMERIC to 'C' in Gyoto::atof. All instances of std::atof + in Gyoto should be replaced by calls to Gyoto::atof. + + (cherry picked from commit bf5b09fc8b1cf5006582cf52bee9a3a77eafb5bc) + +commit 3fc34ec5e5a1bfba54f62c9f19acea1c909ed21c +Author: Frederic Vincent +Date: Thu Jan 30 13:36:55 2020 +0100 + + Expose ThickDisk to python + + (cherry picked from commit 4ade08e5e87451c0f99810b2520ac397bebed951) + +commit 8d9d12407e9371be212b2a720e478c20459f2593 +Author: Frederic Vincent +Date: Thu Jan 23 10:49:52 2020 +0100 + + Adding doc/example/example-thick-disk.xml + + (cherry picked from commit 21e2b8a6b574c81070c95875a55185d843af2e1f) + +commit 9313b41c336e83e2dd745ceaa802bc59028203cf +Author: Eric Gourgoulhon +Date: Thu Jan 23 10:21:42 2020 +0100 + + Small corrections in the install instructions + + (cherry picked from commit c63cb8fdba455df51b3144ae486b8ee66d0d17ff) + +commit ee17672a27e99b814e5e1ced1dd13668ee71545b +Author: Thibaut Paumard +Date: Wed Dec 18 14:13:47 2019 +0100 + + null plugin: load "null", not "obspm". + + (cherry picked from commit 8b76d5495ed53d0f593bc9832c1c4ebcfad4a85f) + +commit 1a14943931b87d3b252e7674bbc437c1c7cfe183 +Author: Thibaut Paumard +Date: Tue Oct 29 14:03:00 2019 +0100 + + Drop Python 2.7 support + + It was lost a some point during summer 2019, and we don't plan on reintroducing it. + + (cherry picked from commit 0fe9301eea584980861576ee8f5b911ea47a893e) + +commit ee6f8e57ad603d2cfe56e0db5eee18a2aaf9bba1 +Author: Frederic Vincent +Date: Mon Nov 18 16:25:43 2019 +0100 + + In ThickDisk.C: adding basic stuff for quick-check + of non-axisymmetric structures + + (cherry picked from commit 00e81b108d634a36f44f3a6ebcda95a905454e09) + +commit 8cd0d5857b92ab43830852a6b29f14a5c5dc514d +Author: Thibaut Paumard +Date: Fri Oct 25 16:59:04 2019 +0200 Releasing 1.4.3 diff -Nru gyoto-1.4.3/configure gyoto-1.4.4/configure --- gyoto-1.4.3/configure 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/configure 2020-02-28 19:19:43.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Gyoto 1.4.3. +# Generated by GNU Autoconf 2.69 for Gyoto 1.4.4. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='Gyoto' PACKAGE_TARNAME='gyoto' -PACKAGE_VERSION='1.4.3' -PACKAGE_STRING='Gyoto 1.4.3' +PACKAGE_VERSION='1.4.4' +PACKAGE_STRING='Gyoto 1.4.4' PACKAGE_BUGREPORT='gyoto@sympa.obspm.fr' PACKAGE_URL='' @@ -1488,7 +1488,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Gyoto 1.4.3 to adapt to many kinds of systems. +\`configure' configures Gyoto 1.4.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1560,7 +1560,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Gyoto 1.4.3:";; + short | recursive ) echo "Configuration of Gyoto 1.4.4:";; esac cat <<\_ACEOF @@ -1809,7 +1809,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Gyoto configure 1.4.3 +Gyoto configure 1.4.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2508,7 +2508,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Gyoto $as_me 1.4.3, which was +It was created by Gyoto $as_me 1.4.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3484,7 +3484,7 @@ # Define the identity of the package. PACKAGE='gyoto' - VERSION='1.4.3' + VERSION='1.4.4' cat >>confdefs.h <<_ACEOF @@ -15742,7 +15742,7 @@ # C: current; R: revision; A: age # Linux library name is: libgyoto.so.(C-A).A.R VERSINFO_C=8 -VERSINFO_R=1 +VERSINFO_R=2 VERSINFO_A=0 VERSINFO=${VERSINFO_C}:${VERSINFO_R}:${VERSINFO_A} @@ -15998,8 +15998,8 @@ for ac_prog in python3 python \ python3 \ - python2 \ - python4.0 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 + \ + python4.0 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -16525,7 +16525,7 @@ PYTHON="" fi if test "x$with_python" = xyes && test "x$PYTHON" = x; then : - as_fn_error $? "Python requested but no supported version found (>=2.7, <4.0)" "$LINENO" 5 + as_fn_error $? "Python requested but no supported version found (>=3.0, <4.0)" "$LINENO" 5 fi @@ -21960,7 +21960,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Gyoto $as_me 1.4.3, which was +This file was extended by Gyoto $as_me 1.4.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22026,7 +22026,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Gyoto config.status 1.4.3 +Gyoto config.status 1.4.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru gyoto-1.4.3/configure.ac gyoto-1.4.4/configure.ac --- gyoto-1.4.3/configure.ac 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/configure.ac 2020-02-28 19:19:43.000000000 +0000 @@ -10,7 +10,7 @@ AC_PREREQ([2.69]) -AC_INIT([Gyoto], [1.4.3], [gyoto@sympa.obspm.fr]) +AC_INIT([Gyoto], [1.4.4], [gyoto@sympa.obspm.fr]) gyoto_test_CXXFLAGS=${CXXFLAGS+set} gyoto_test_CPPFLAGS=${CPPFLAGS+set} AC_CANONICAL_SYSTEM @@ -27,7 +27,7 @@ # C: current; R: revision; A: age # Linux library name is: libgyoto.so.(C-A).A.R VERSINFO_C=8 -VERSINFO_R=1 +VERSINFO_R=2 VERSINFO_A=0 VERSINFO=${VERSINFO_C}:${VERSINFO_R}:${VERSINFO_A} AC_SUBST([VERSINFO]) @@ -136,7 +136,7 @@ ], []) -PC_PROG_PYTHON([python3], [2.7], [4.0]) +PC_PROG_PYTHON([python3], [3.0], [4.0]) PC_PYTHON_PROG_PYTHON_CONFIG PC_PYTHON_CHECK_HEADERS( [ @@ -152,7 +152,7 @@ ],[PYTHON=""]) AS_IF([test "x$with_python" = xno], [PYTHON=""]) AS_IF([test "x$with_python" = xyes && test "x$PYTHON" = x], - [AC_MSG_ERROR([Python requested but no supported version found (>=2.7, <4.0)])]) + [AC_MSG_ERROR([Python requested but no supported version found (>=3.0, <4.0)])]) AC_ARG_WITH([virtualenv], [AS_HELP_STRING([--with-virtualenv], [install to a Python virtualenv])], diff -Nru gyoto-1.4.3/debian/changelog gyoto-1.4.4/debian/changelog --- gyoto-1.4.3/debian/changelog 2020-02-18 09:19:53.000000000 +0000 +++ gyoto-1.4.4/debian/changelog 2020-03-09 16:03:13.000000000 +0000 @@ -1,20 +1,31 @@ -gyoto (1.4.3-1build3) focal; urgency=medium +gyoto (1.4.4-3) unstable; urgency=high - * No-change rebuild to drop python3.7. + * Avoid FTBFS on mips64el due to bug in libflint-arb2 - -- Matthias Klose Tue, 18 Feb 2020 10:19:53 +0100 + -- Thibaut Paumard Mon, 09 Mar 2020 17:03:13 +0100 -gyoto (1.4.3-1build2) focal; urgency=medium +gyoto (1.4.4-2) unstable; urgency=high - * No change rebuild against new boost1.71 ABI + * Bug fix: "gyoto FTBFS on armel, armhf, mipsel and mips64el", thanks to + peter green (Closes: #953151). Skip FlaredDiskSynchrotron in Python + test suite to avoid triggering a minor bug that is not fixable without + breaking the ABI. - -- Dimitri John Ledkov Wed, 12 Feb 2020 13:26:57 +0000 + -- Thibaut Paumard Fri, 06 Mar 2020 10:02:20 +0100 -gyoto (1.4.3-1build1) focal; urgency=medium +gyoto (1.4.4-1) unstable; urgency=low - * No change rebuild against new boost1.71 ABI + * New upstream release + * Rename variable ADTTMP to AUTOPKGTEST_TMP in test suite. - -- Dimitri John Ledkov Mon, 03 Feb 2020 20:33:41 +0000 + -- Thibaut Paumard Fri, 28 Feb 2020 20:38:23 +0100 + +gyoto (1.4.3-2) unstable; urgency=low + + * Bug fix: "gyoto build depends on the removed swig3.0", thanks to + Adrian Bunk (Closes: #952598). + + -- Thibaut Paumard Thu, 27 Feb 2020 17:25:52 +0100 gyoto (1.4.3-1) unstable; urgency=low diff -Nru gyoto-1.4.3/debian/control gyoto-1.4.4/debian/control --- gyoto-1.4.3/debian/control 2020-02-03 20:33:41.000000000 +0000 +++ gyoto-1.4.4/debian/control 2020-03-09 16:03:13.000000000 +0000 @@ -1,8 +1,7 @@ Source: gyoto Section: science Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian Astronomy Maintainers +Maintainer: Debian Astronomy Maintainers Uploaders: Thibaut Paumard Build-Depends: debhelper-compat (= 12), yorick-dev, yorick-yutils, libxerces-c-dev, libcfitsio-dev, libudunits2-dev, automake, @@ -10,13 +9,13 @@ libflint-arb-dev, libflint-dev, mpi-default-dev, dh-python, python3-all-dev, python3-setuptools, - swig3.0, python3-numpy, doxygen, dh-exec (>=0.3), + swig, python3-numpy, doxygen, dh-exec (>=0.3), pkg-config, liblorene-dev, lorene-codes-src, gfortran, g++ (>= 4:7) Build-Depends-Indep: doxygen-latex, texlive-bibtex-extra, texlive-latex-base, texlive-lang-french, tipa -Standards-Version: 4.4.1 +Standards-Version: 4.5.0 Vcs-Git: https://salsa.debian.org/science-team/gyoto.git Vcs-Browser: https://salsa.debian.org/science-team/gyoto Homepage: http://gyoto.obspm.fr diff -Nru gyoto-1.4.3/debian/patches/python_tests gyoto-1.4.4/debian/patches/python_tests --- gyoto-1.4.3/debian/patches/python_tests 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-1.4.4/debian/patches/python_tests 2020-03-09 16:03:13.000000000 +0000 @@ -0,0 +1,22 @@ +Description: Skip FlaredDiskSynchrotron in python tests + FlaredDiskSynchrotron has a bug that causes segfaults in tests, it is not + fixable without breaking the ABI so let's skip the test for now. Next minor + upstream release will include a proper fix. +Author: Thibaut Paumard +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953151 +Forwarded: not-needed +Last-Update: 2020-03-05 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/python/tests/core.py ++++ b/python/tests/core.py +@@ -36,7 +36,8 @@ + if (classname in ('Generic', + gnspace, + 'StandardAstrobj', +- 'UniformSphere') ++ 'UniformSphere', ++ 'FlaredDiskSynchrotron') + or not inspect.isclass(cls)): + continue + # The XML name of ComplexAstrobj et al. is 'Complex' diff -Nru gyoto-1.4.3/debian/patches/series gyoto-1.4.4/debian/patches/series --- gyoto-1.4.3/debian/patches/series 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/patches/series 2020-03-09 16:03:13.000000000 +0000 @@ -1,3 +1,4 @@ interpreter-path # This patch is conditionally applied by debian/rules: # no-fp-ilogb0 +python_tests diff -Nru gyoto-1.4.3/debian/rules gyoto-1.4.4/debian/rules --- gyoto-1.4.3/debian/rules 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/rules 2020-03-09 16:03:13.000000000 +0000 @@ -104,14 +104,21 @@ override_dh_auto_clean: [ ! -f python/Makefile ] || make -C python clean - rm -Rf python-plugins debian/include python/_*.so + rm -Rf python-plugins debian/include python/_*.so python/gyoto/_*.so dh_auto_clean --no-parallel override_dh_auto_test-indep: override_dh_auto_test-arch: -ifeq (,$(filter $(DEB_HOST_ARCH), mips)) +ifeq (,$(filter $(DEB_HOST_ARCH), mips mips64el)) # skip on mips as lucatelli2 fails on it (but the binary works on other boxes) +# +# 20200228: For some reason the behavior of setup.py test changed to +# that we need to put all the .so files in python/gyoto. This should +# be fixed upstream in a better manner. +# +# 20200309: skip mips64el due to segfault in libflint-arb2 (#953437) + cp -a python/build/*/gyoto/_*.so python/gyoto/ LC_ALL=C.UTF-8 dh_auto_test -- check-lorene endif diff -Nru gyoto-1.4.3/debian/tests/gyoto gyoto-1.4.4/debian/tests/gyoto --- gyoto-1.4.3/debian/tests/gyoto 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/gyoto 2020-03-09 16:03:13.000000000 +0000 @@ -5,14 +5,14 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Save current directory (must be top of source tree) diff -Nru gyoto-1.4.3/debian/tests/gyoto-lorene gyoto-1.4.4/debian/tests/gyoto-lorene --- gyoto-1.4.3/debian/tests/gyoto-lorene 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/gyoto-lorene 2020-03-09 16:03:13.000000000 +0000 @@ -5,14 +5,14 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Save current directory (must be top of source tree) @@ -20,8 +20,8 @@ # Compute Lorene metric using Nrotstar "code" export HOME_LORENE=/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/lorene -mkdir -p ${ADTTMP}/${script} -cd ${ADTTMP}/${script} +mkdir -p ${AUTOPKGTEST_TMP}/${script} +cd ${AUTOPKGTEST_TMP}/${script} rm -Rf .check-lorene cp -a ${HOME_LORENE}/Codes/Nrotstar ./.check-lorene cd .check-lorene diff -Nru gyoto-1.4.3/debian/tests/gyoto-lorene-mpi gyoto-1.4.4/debian/tests/gyoto-lorene-mpi --- gyoto-1.4.3/debian/tests/gyoto-lorene-mpi 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/gyoto-lorene-mpi 2020-03-09 16:03:13.000000000 +0000 @@ -5,14 +5,14 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Save current directory (must be top of source tree) @@ -20,8 +20,8 @@ # Compute Lorene metric using Nrotstar "code" export HOME_LORENE=/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/lorene -mkdir -p ${ADTTMP}/${script} -cd ${ADTTMP}/${script} +mkdir -p ${AUTOPKGTEST_TMP}/${script} +cd ${AUTOPKGTEST_TMP}/${script} rm -Rf .check-lorene cp -a ${HOME_LORENE}/Codes/Nrotstar ./.check-lorene cd .check-lorene @@ -42,7 +42,7 @@ # Setup MPI environment to run on localhost with enough slots export OMPI_MCA_plm_rsh_agent=/bin/false export OMPI_MCA_btl_tcp_if_include=lo -HOSTFILE="${ADTTMP}"/hostfile.${script} +HOSTFILE="${AUTOPKGTEST_TMP}"/hostfile.${script} echo localhost slots=5 > "${HOSTFILE}" MPIRUN_CMD="mpirun.openmpi -np 1 --hostfile ${HOSTFILE}" diff -Nru gyoto-1.4.3/debian/tests/gyoto-mk-video gyoto-1.4.4/debian/tests/gyoto-mk-video --- gyoto-1.4.3/debian/tests/gyoto-mk-video 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/gyoto-mk-video 2020-03-09 16:03:13.000000000 +0000 @@ -5,14 +5,14 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Save current directory (must be top of source tree) diff -Nru gyoto-1.4.3/debian/tests/gyoto-mpi gyoto-1.4.4/debian/tests/gyoto-mpi --- gyoto-1.4.3/debian/tests/gyoto-mpi 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/gyoto-mpi 2020-03-09 16:03:13.000000000 +0000 @@ -5,14 +5,14 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Save current directory (must be top of source tree) @@ -28,7 +28,7 @@ # Setup MPI environment to run on localhost with enough slots export OMPI_MCA_plm_rsh_agent=/bin/false export OMPI_MCA_btl_tcp_if_include=lo -HOSTFILE="${ADTTMP}"/hostfile.${script} +HOSTFILE="${AUTOPKGTEST_TMP}"/hostfile.${script} echo localhost slots=5 > "${HOSTFILE}" MPIRUN_CMD="mpirun.openmpi -np 1 --hostfile ${HOSTFILE}" diff -Nru gyoto-1.4.3/debian/tests/python-gyoto gyoto-1.4.4/debian/tests/python-gyoto --- gyoto-1.4.3/debian/tests/python-gyoto 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/python-gyoto 2020-03-09 16:03:13.000000000 +0000 @@ -5,24 +5,24 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Save current directory (must be top of source tree) SRC_ROOT=`pwd` # Setup Python example tree structure -mkdir -p ${ADTTMP}/doc -cp -a doc/examples ${ADTTMP}/doc/ -mkdir -p ${ADTTMP}/python -cd ${ADTTMP}/python +mkdir -p ${AUTOPKGTEST_TMP}/doc +cp -a doc/examples ${AUTOPKGTEST_TMP}/doc/ +mkdir -p ${AUTOPKGTEST_TMP}/python +cd ${AUTOPKGTEST_TMP}/python echo "backend : PDF" > matplotlibrc cp ${SRC_ROOT}/plugins/python/doc/examples/* ./ cp ${SRC_ROOT}/python/example.py ./ diff -Nru gyoto-1.4.3/debian/tests/python-gyoto-mpi gyoto-1.4.4/debian/tests/python-gyoto-mpi --- gyoto-1.4.3/debian/tests/python-gyoto-mpi 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/python-gyoto-mpi 2020-03-09 16:03:13.000000000 +0000 @@ -5,24 +5,24 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Save current directory (must be top of source tree) SRC_ROOT=`pwd` # Setup Python example tree structure -mkdir -p ${ADTTMP}/doc -cp -a doc/examples ${ADTTMP}/doc/ -mkdir -p ${ADTTMP}/python -cd ${ADTTMP}/python +mkdir -p ${AUTOPKGTEST_TMP}/doc +cp -a doc/examples ${AUTOPKGTEST_TMP}/doc/ +mkdir -p ${AUTOPKGTEST_TMP}/python +cd ${AUTOPKGTEST_TMP}/python echo "backend : PDF" > matplotlibrc cp ${SRC_ROOT}/plugins/python/doc/examples/* ./ cp ${SRC_ROOT}/python/example-mpi.py ./ @@ -36,7 +36,7 @@ # Setup MPI environment to run on localhost with enough slots export OMPI_MCA_plm_rsh_agent=/bin/false export OMPI_MCA_btl_tcp_if_include=lo -HOSTFILE="${ADTTMP}"/hostfile.${script} +HOSTFILE="${AUTOPKGTEST_TMP}"/hostfile.${script} echo localhost slots=5 > "${HOSTFILE}" MPIRUN_CMD="mpirun.openmpi -np 5 --hostfile ${HOSTFILE}" diff -Nru gyoto-1.4.3/debian/tests/yorick-gyoto gyoto-1.4.4/debian/tests/yorick-gyoto --- gyoto-1.4.3/debian/tests/yorick-gyoto 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/yorick-gyoto 2020-03-09 16:03:13.000000000 +0000 @@ -5,14 +5,14 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Run yorick script diff -Nru gyoto-1.4.3/debian/tests/yorick-gyoto.i gyoto-1.4.4/debian/tests/yorick-gyoto.i --- gyoto-1.4.3/debian/tests/yorick-gyoto.i 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/yorick-gyoto.i 2020-03-09 16:03:13.000000000 +0000 @@ -5,7 +5,7 @@ // get or set a few variables SRC_ROOT=cd("."); -ADTTMP=get_env("ADTTMP"); +AUTOPKGTEST_TMP=get_env("ADTTMP"); GYOTO_EXAMPLES_DIR=SRC_ROOT+"doc/examples/"; GYOTO_CHECK_NODISPLAY="true" @@ -16,8 +16,8 @@ xytitles = fma = winkill = pli = plg = pause = window = noop; // get scripts -mkdirp, ADTTMP; -cd, ADTTMP; +mkdirp, AUTOPKGTEST_TMP; +cd, AUTOPKGTEST_TMP; system, "cp -f " + SRC_ROOT +"yorick/*.i ./"; // run upstream test suite diff -Nru gyoto-1.4.3/debian/tests/yorick-gyoto-mpi gyoto-1.4.4/debian/tests/yorick-gyoto-mpi --- gyoto-1.4.3/debian/tests/yorick-gyoto-mpi 2019-10-29 12:29:50.000000000 +0000 +++ gyoto-1.4.4/debian/tests/yorick-gyoto-mpi 2020-03-09 16:03:13.000000000 +0000 @@ -5,20 +5,20 @@ script=`basename "$0"` # Handle case of manually running this script -if [ "$ADTTMP" = "" ]; then - ADTTMP=`mktemp -d --tmpdir "$script"-XXX`; - echo "ADTTMP is $ADTTMP"; +if [ "$AUTOPKGTEST_TMP" = "" ]; then + AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; + echo "AUTOPKGTEST_TMP is $ADTTMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then - ADT_ARTIFACTS=${ADTTMP}/artifacts + ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi -mkdir -p "${ADTTMP}" +mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Setup MPI environment to run on localhost with enough slots export OMPI_MCA_plm_rsh_agent=/bin/false export OMPI_MCA_btl_tcp_if_include=lo -HOSTFILE="${ADTTMP}"/hostfile.${script} +HOSTFILE="${AUTOPKGTEST_TMP}"/hostfile.${script} echo localhost slots=9 > "${HOSTFILE}" MPIRUN_CMD="mpirun.openmpi -np 1 --hostfile ${HOSTFILE}" diff -Nru gyoto-1.4.3/doc/examples/example-thick-disk.xml gyoto-1.4.4/doc/examples/example-thick-disk.xml --- gyoto-1.4.3/doc/examples/example-thick-disk.xml 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-1.4.4/doc/examples/example-thick-disk.xml 2020-02-28 19:19:43.000000000 +0000 @@ -0,0 +1,39 @@ + + + 0.1 + + Setup adapted to M87* + 6.2e9 + 0.8 + + + Setup adapted to M87* + 16.9 + 27.169411e3 + 80 + 20 i = 180° - Inclination = 160° + 70 Spin PA East of North = 180° - PALN = 110° [360°] + so Jet PA East of North is 290° as the jet is counter-aligned + 50 + 11.36 11.36 + + + Spectrum + + + + 1.1 + 1.6 + 0.61 1. V, Vphi/V as observed by ZAMO + 7.8e5 + 8e10 + 1. + 0.1 + 30. + 0.1 + + + -1e10 + 8 + + diff -Nru gyoto-1.4.3/doc/user_guide/GyotoManual.tex gyoto-1.4.4/doc/user_guide/GyotoManual.tex --- gyoto-1.4.3/doc/user_guide/GyotoManual.tex 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/doc/user_guide/GyotoManual.tex 2020-02-28 19:19:43.000000000 +0000 @@ -64,7 +64,7 @@ % Let's enter the date manually. Need to update it at least for each % release. Use git log to find out the last change to the user manual. -\Large{Updated September 5, 2019} +\Large{Updated October 29, 2019} %\today \vspace{4cm} @@ -400,9 +400,7 @@ How to build and install these extensions is documented in INSTALL. At the moment, this is not done automatically. The requisites are: \begin{itemize} -\item Python (we use on recent Python 3, we support older releases - down to Python 2.7 on a best effot basis), including the development - files; +\item Python 3, including the development files; \item Swig (tested with 2.0.12 and 3.0.2); \item NumPy, installed with its development files for the specific Python interpreter you plan on using. @@ -1283,7 +1281,7 @@ \item \texttt{stdplug}, which contain all the standard analytical metrics and all the standard astrophysical object; \item \texttt{python}, which allows implementing new \Metric, - \Astrobj, and \Spectrum\ classes in the Python (2 or 3) language; + \Astrobj, and \Spectrum\ classes in the Python 3 language; \item and \texttt{lorene}, which contains the numerical, LORENE-based metrics. \end{itemize} diff -Nru gyoto-1.4.3/include/GyotoGridData2D.h gyoto-1.4.4/include/GyotoGridData2D.h --- gyoto-1.4.3/include/GyotoGridData2D.h 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/include/GyotoGridData2D.h 2020-02-28 19:19:43.000000000 +0000 @@ -6,7 +6,7 @@ */ /* - Copyright (c) 2019 Frederic Vincent, Thibaut Paumard + Copyright (c) 2019-2020 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -107,7 +107,7 @@ * \brief Creates a FITS file with dummy primary HDU * * - * Opens a new fits file refered to by a fitsfile pointer + * Opens a new fits file referred to by a fitsfile pointer * and fills the primary HDU by a single pixel equal to 0. * Returns the fitsfile pointer to the new FITS file. * @@ -117,7 +117,7 @@ fitsfile* fitsCreate(std::string filename); /** - * \brief Closes a fits file refered to by a fitsfile pointer + * \brief Closes a fits file referred to by a fitsfile pointer * * * \param fptr fitsfile pointer to FITS file to be closed diff -Nru gyoto-1.4.3/include/Gyoto.h gyoto-1.4.4/include/Gyoto.h --- gyoto-1.4.3/include/Gyoto.h 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/include/Gyoto.h 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,6 @@ /* - Copyright 2011-2016 Thibaut Paumard + Copyright 2011-2016, 2018-2019 Thibaut Paumard, Frédéric Vincent, + Éric Gourgoulhon This file is part of Gyoto. @@ -66,7 +67,7 @@ * Gyoto aims at providing a framework for computing orbits and * ray-traced images in General relativity. It consists of a library * (libgyoto), utility programs, a plug-in for the Yorick programing - * language, and an extension for the Python (2 and 3) programing + * language, and an extension for the Python 3 programing * language. Gyoto is known to run under Linux and Mac OS X. Please do * tell us if you manage to run Gyoto under a different OS. It should * compile and run with moderate effort on most UNIX-like systems. @@ -79,18 +80,18 @@ * writing_plugins_page). Custom Gyoto::Metric::Generic, * Gyoto::Astrobj::Generic and Gyoto::Spectrum::Generic classes can * also be written in the Python - * (2.7 or 3.x) interpreted language using the \c python plug-in for - * Gyoto, see below. Beware that a Python implementation of a custom - * class will run significantly slower than the equivalent C++ - * implementation, but sometimes saving on development time is better - * than saving on computing time. + * 3.x interpreted language using the \c python plug-in for Gyoto, see + * below. Beware that a Python implementation of a custom class will + * run significantly slower than the equivalent C++ implementation, + * but sometimes saving on development time is better than saving on + * computing time. * * The base distribution includes three plug-ins: the standard plug-in * (\c stdplug), a plug-in for using LORENE-based * numerical metrics (\c lorene) and a plug-in for writing custom * astronomical objects or metrics in the Python (2.7 or 3.x) interpreted + * HREF="https://www.python.org/">Python 3.x interpreted * language (\c python). * * A graphical user interface for tracing stellar orbits is provided diff -Nru gyoto-1.4.3/include/GyotoSmartPointer.h gyoto-1.4.4/include/GyotoSmartPointer.h --- gyoto-1.4.3/include/GyotoSmartPointer.h 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/include/GyotoSmartPointer.h 2020-02-28 19:19:43.000000000 +0000 @@ -17,7 +17,7 @@ */ /* - Copyright 2011-2014, 2016 Thibaut Paumard + Copyright 2011-2014, 2016, 2020 Thibaut Paumard This file is part of Gyoto. diff -Nru gyoto-1.4.3/INSTALL.Gyoto.md gyoto-1.4.4/INSTALL.Gyoto.md --- gyoto-1.4.3/INSTALL.Gyoto.md 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/INSTALL.Gyoto.md 2020-02-28 19:19:43.000000000 +0000 @@ -52,42 +52,20 @@ sudo port install Boost +openmpi sudo port install Gyoto +openmpi - -## 1- Downloading the source code +## 1- Building from source: installing the dependencies If Gyoto is not packaged for your system or if you prefer to build from source, read on. -The source code is available from -[Github](https://github.com/gyoto/Gyoto): - - git clone git://github.com/gyoto/Gyoto.git - -(This obviously requires git to be installed on your system, on Debian -and derivtives use 'sudo apt-get install git'). - -Then the build process is, in a nutshell, after having installed the -dependencies: - - ./git-post-merge - ./configure - make - sudo make install - sudo ldconfig - -The rest of this file details each step. - - -## 2- Installing the dependencies - -Please refer to [BUGS.md](BUGS.md) for known bugs in some versions of the -following dependencies. +The first step is to install the dependencies. Please refer to +[BUGS.md](BUGS.md) for known bugs in some versions of the following +dependencies. Gyoto requires: - a C++ compiler. GCC 4.9 and above work very well. Several features require the C++11 standard. Clang/LLVM is discouraged, - see [BUGS.md](BUGS.md). + see [BUGS.md](BUGS.md). - xercesc-3 (recommended, required for the executable): http://xerces.apache.org/xerces-c/ - cfitsio (required for the executable and some of the Astrobj): @@ -113,11 +91,12 @@ Yorick users will also need the yorick-yutils add-on (https://github.com/frigaut/yorick-yutils) and may need to install the yorick-dev package (in particulat Debian/Ubuntu users). - - Python (optional, provides an interface to the Python interpreted - language, allowing to write Gyoto scripts). Python 2.7 and 3.4 - have been tested. For building the Python bindings, the Python - development files are naturally required (sometimes found in the - python-dev or python3-dev package), as well as NumPy and Swig-2.0: + - Python 3 (optional, provides an interface to the Python + interpreted language, allowing to write Gyoto scripts). Python + 3.7 and 3.8 have been tested. For building the Python bindings, + the Python development files are naturally required (sometimes + found in the python-dev or python3-dev package), as well as NumPy + and Swig-2.0: https://www.python.org/ http://www.numpy.org/ http://www.swig.org/ @@ -126,18 +105,41 @@ scripts, or contact us is stability of the API is important for you. - LORENE (optional, the libgyoto-lorene plug-in can be built later): - http://www.lorene.obspm.fr/ + https://www.lorene.obspm.fr/ On some systems, LORENE must be built with -fPIC (GYOTO as well, but this is the default). - developers may need the GNU autotools: autoconf, automake, libtool. For Debian and its derivatives (incl. Ubuntu), you can install all those dependencies with: - sudo apt-get install build-essential yorick-dev yorick-yutils \ - libxerces-c-dev libcfitsio-dev libudunits2-dev libboost-dev \ - libboost-mpi-dev libflint-arb-dev libflint-dev mpi-default-dev \ - python3-dev python3-setuptools swig3.0 python3-numpy doxygen \ - pkg-config liblorene-dev lorene-codes-src gfortran g++ + + sudo apt-get install build-essential yorick-dev yorick-yutils \ + libxerces-c-dev libcfitsio-dev libudunits2-dev libboost-dev \ + libboost-mpi-dev libflint-arb-dev libflint-dev mpi-default-dev \ + python3-dev python3-setuptools swig3.0 python3-numpy python3-matplotlib \ + doxygen pkg-config liblorene-dev lorene-codes-src gfortran g++ + +## 2- Downloading the source code + +The source code is available from +[Github](https://github.com/gyoto/Gyoto): + + git clone https://github.com/gyoto/Gyoto.git + +(This obviously requires git to be installed on your system, on Debian +and derivtives use `sudo apt-get install git`). + +Then the build process is, in a nutshell, after having installed the +dependencies: + + ./git-post-merge + ./configure + make + sudo make install + sudo ldconfig + +The rest of this file details each step. + ## 3- Fixing the timestamps @@ -170,7 +172,7 @@ ARBLIB is known to be installed under various names depending on the Linux distribution. If using ARBLIB (see "Installing the dependencies" -above), you may need to set the --with-arblib-ldflags variable to the +above), you may need to set the `--with-arblib-ldflags` variable to the correct name, e.g. ./configure --with-arblib-ldflags=-larb @@ -178,7 +180,7 @@ The standard GNU INSTALL file is provided next to this file and documents the most standard and obscure features. -The --enable-release option is reserved for pre-compiled package +The `--enable-release` option is reserved for pre-compiled package maintainers. In short, don't use it, it is for us alone. Without this option, the library name will contain "-unreleased". This is to allow users to compile new versions without overriding the system-provided @@ -209,8 +211,9 @@ On Debian or Ubuntu, with all the dependencies installed as above, this should do: - ./configure --with-arblib \ - --with-lorene=/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/lorene + + ./configure --with-arblib \ + --with-lorene=/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/lorene ## 5- Building Gyoto diff -Nru gyoto-1.4.3/lib/BlackBodySpectrum.C gyoto-1.4.4/lib/BlackBodySpectrum.C --- gyoto-1.4.3/lib/BlackBodySpectrum.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/BlackBodySpectrum.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011-2012, 2014, 2017, 2019 Thibaut Paumard & Frederic Vincent + Copyright 2011-2012, 2014, 2017, 2019-2020 Thibaut Paumard & Frederic Vincent This file is part of Gyoto. @@ -20,7 +20,6 @@ #include "GyotoBlackBodySpectrum.h" #include "GyotoDefs.h" #include -#include /* atof */ #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #include "GyotoFactoryMessenger.h" diff -Nru gyoto-1.4.3/lib/Blob.C gyoto-1.4.4/lib/Blob.C --- gyoto-1.4.3/lib/Blob.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/Blob.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2019 Frederic Vincent, Thibaut Paumard + Copyright 2019, 2020 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -216,7 +216,10 @@ // Converts internal M-unit time to SI double tt=timeRef_M_; # ifdef HAVE_UDUNITS - tt = Units::ToSeconds(tt,"geometrical_time",gg_); + if (gg_) + tt = Units::ToSeconds(tt,"geometrical_time",gg_); + else + GYOTO_SEVERE << "Cannot convert to seconds as metric is not set!" << endl; # else GYOTO_WARNING << "Units ignored, please recompile Gyoto with --with-udunits" << endl ; @@ -246,7 +249,10 @@ void Blob::timeRef(double tt, string const &unit) { if (unit != "") { # ifdef HAVE_UDUNITS - tt = Units::ToSeconds(tt,unit,gg_); + if (gg_) + tt = Units::ToSeconds(tt,unit,gg_); + else + GYOTO_SEVERE << "Cannot convert to seconds as metric is not set!" << endl; # else GYOTO_WARNING << "Units ignored, please recompile Gyoto with --with-udunits" << endl ; @@ -259,7 +265,10 @@ // Converts internal M-unit time to SI double tt=timeSigma_M_; # ifdef HAVE_UDUNITS - tt = Units::ToSeconds(tt,"geometrical_time",gg_); + if (gg_) + tt = Units::ToSeconds(tt,"geometrical_time",gg_); + else + GYOTO_SEVERE << "Cannot convert to seconds as metric is not set!" << endl; # else GYOTO_WARNING << "Units ignored, please recompile Gyoto with --with-udunits" << endl ; diff -Nru gyoto-1.4.3/lib/DynamicalDisk3D.C gyoto-1.4.4/lib/DynamicalDisk3D.C --- gyoto-1.4.3/lib/DynamicalDisk3D.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/DynamicalDisk3D.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011-2016, 2018 Frederic Vincent, Thibaut Paumard + Copyright 2013-2016, 2018-2020 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -61,7 +61,10 @@ nb_times_(1), PLindex_(3), novel_(0), - floortemperature_(0) + floortemperature_(0), + emission_array_(NULL), + velocity_array_(NULL), + absorption_array_(NULL) { GYOTO_DEBUG << "DynamicalDisk3D Construction" << endl; spectrumBB_ = new Spectrum::BlackBody(); @@ -77,7 +80,10 @@ nb_times_(o.nb_times_), PLindex_(o.PLindex_), novel_(o.novel_), - floortemperature_(o.floortemperature_) + floortemperature_(o.floortemperature_), + emission_array_(NULL), + velocity_array_(NULL), + absorption_array_(NULL) { GYOTO_DEBUG << "DynamicalDisk3D Copy" << endl; if (o.spectrumBB_()) spectrumBB_=o.spectrumBB_->clone(); @@ -132,9 +138,9 @@ DynamicalDisk3D::~DynamicalDisk3D() { GYOTO_DEBUG << "DynamicalDisk3D Destruction" << endl; - delete [] emission_array_; + if (emission_array_) delete [] emission_array_; if (absorption_array_) delete [] absorption_array_; - delete [] velocity_array_; + if (velocity_array_) delete [] velocity_array_; } double const * DynamicalDisk3D::getVelocity() const { return Disk3D::getVelocity(); } diff -Nru gyoto-1.4.3/lib/EquatorialHotSpot.C gyoto-1.4.4/lib/EquatorialHotSpot.C --- gyoto-1.4.3/lib/EquatorialHotSpot.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/EquatorialHotSpot.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2013, 2018 Frederic Vincent, Thibaut Paumard + Copyright 2016, 2018-2020 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -106,7 +106,7 @@ GYOTO_WARNING << " " << content << "" << endl; GYOTO_WARNING <<" instead"; beaming(name); - beamangle_=atof(content.c_str()); + setParameter("BeamAngle", content, unit); } else return ThinDisk::setParameter(name, content, unit); return 0; } diff -Nru gyoto-1.4.3/lib/Factory.C gyoto-1.4.4/lib/Factory.C --- gyoto-1.4.3/lib/Factory.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/Factory.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011-2016, 2018 Thibaut Paumard + Copyright 2011-2016, 2018-2020 Thibaut Paumard This file is part of Gyoto. @@ -28,6 +28,11 @@ #include #include #include +#include + +// Let's imbue 'C' locale to every stream to make sure decimal_point +// is always actually a '.' +static std::locale Cloc("C"); #include "GyotoMetric.h" #include "GyotoAstrobj.h" @@ -51,12 +56,18 @@ #define dfmt " %.16g " // support DBL_MIN, DBL_MAX, and put right format -#define d2txt(txt, val) \ +#define d2txt(txt, val) \ if (val== DBL_MAX) strcpy(txt, "DBL_MAX"); \ else if (val==-DBL_MAX) strcpy(txt, "-DBL_MAX"); \ else if (val== DBL_MIN) strcpy(txt, "DBL_MIN"); \ else if (val==-DBL_MIN) strcpy(txt, "-DBL_MIN"); \ - else sprintf( txt , dfmt, val) + else { \ + ostringstream ss; \ + ss.imbue(Cloc); \ + ss << setprecision(GYOTO_PREC) \ + << setw(GYOTO_WIDTH) << val; \ + strcpy(txt, ss.str().c_str()); \ + } #define ifmt " %li " #define i2txt(txt, val) sprintf( txt, ifmt, val); @@ -465,7 +476,7 @@ : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), obj_el_(NULL), ph_el_(NULL), scenery_(sc), gg_(sc->metric()), - screen_(sc->screen()), obj_(sc->astrobj()), + screen_(NULL), obj_(sc->astrobj()), photon_(NULL), spectro_(NULL), filename_("") { GYOTO_DEBUG << "Initializing XML stuff" << endl; @@ -646,14 +657,15 @@ if (screen_ && scr && scr!= screen_) GYOTO_ERROR("Inconsistent use of Screens"); - screen_ = scr; + if (scr && !screen_) { + screen_ = scr; - DOMElement * scr_el = doc_->createElement(X("Screen")); - el->appendChild(scr_el); - - FactoryMessenger fm(this, scr_el); - scr -> fillElement(&fm); + DOMElement * scr_el = doc_->createElement(X("Screen")); + el->appendChild(scr_el); + FactoryMessenger fm(this, scr_el); + scr -> fillElement(&fm); + } } void Factory::write(const char* const goutputfile) { @@ -762,6 +774,7 @@ size_t n, DOMElement *pel, FactoryMessenger **child){ ostringstream ss; + ss.imbue(Cloc); // set local to 'C' ss << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << val[0]; for (size_t i=1; i -#include /* atof */ #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #include "GyotoFactoryMessenger.h" diff -Nru gyoto-1.4.3/lib/KerrBL.C gyoto-1.4.4/lib/KerrBL.C --- gyoto-1.4.3/lib/KerrBL.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/KerrBL.C 2020-02-28 19:19:43.000000000 +0000 @@ -270,9 +270,13 @@ Sigmam3=Sigmam2*Sigmam1, a2cthsth=a2_*cth*sth, rSigmam1=r*Sigmam1, - Deltam1Sigmam2=Deltam1*Sigmam2; + Deltam1Sigmam2=Deltam1*Sigmam2, + r2plusa2 = r2+a2_; - double term1=(a2_+2.*r2+a2_*c2th), term1m1=1./term1; + // These formulas are taken from Semerak, MNRAS, 308, 863 (1999) + // appendix A, and have been compared against the SageMath expressions + // for some particular spacetime point (not in the equatorial plane); + // they agree at machine precision dst[1][1][1]=(1.-r)*Deltam1+rSigmam1; dst[1][2][1]=dst[1][1][2]=-a2cthsth*Sigmam1; @@ -280,35 +284,24 @@ dst[1][3][3]=-Delta*sth2*(r+(a2_*(-2.*r2+Sigma)*sth2)/Sigma2)/Sigma; dst[1][3][0]=dst[1][0][3]=spin_*Delta*(-2*r2+Sigma)*sth2*Sigmam3; dst[1][0][0]=-Delta*(-2.*r2+Sigma)*Sigmam3; - dst[2][1][1]=a2cthsth/(Delta*(r2+a2_*cth2)); + dst[2][1][1]=a2cthsth*Deltam1*Sigmam1; dst[2][2][1]=dst[2][1][2]=rSigmam1; dst[2][2][2]=-a2cthsth*Sigmam1; dst[2][3][3]= - -((a2_+r2)*Sigma2+4.*a2_*r*Sigma*sth2+2.*a4_*r*sth4)*s2th*0.5*Sigmam3; - dst[2][0][3]=dst[2][3][0]=spin_*r*(Sigma+a2_*sth2)*s2th*Sigmam3; + -sth*cth*Sigmam3 * (Delta*Sigma2 + 2.*r*r2plusa2*r2plusa2); + dst[2][0][3]=dst[2][3][0]=spin_*r*r2plusa2*s2th*Sigmam3; dst[2][0][0]=-2.*a2cthsth*r*Sigmam3; dst[3][3][1]=dst[3][1][3]= - (2.*r*Sigma*((-2.+r)*r+a2_*cth2)+2.*a2_*(-2.*r2+Sigma)*sth2) - *Deltam1*Sigmam1*term1m1; + Deltam1*Sigmam2 * (r*Sigma*(Sigma-2.*r) + a2_*(Sigma-2.*r2)*sth2); dst[3][3][2]=dst[3][2][3]= - (2.*(a2_+r2)*Sigma2*(term1-4.*r)*ctgth+ - a2_*r*s2th*(8.*(-1.+r)*r*Sigma+a2_*(8.*Sigma*cth2+4.*r2*sth2+a2_*s2th2))) - *0.5*Deltam1Sigmam2*term1m1; + Sigmam2*ctgth * (-(Sigma+Delta)*a2_*sth2 + r2plusa2*r2plusa2); dst[3][0][1]=dst[3][1][0]=spin_*(2.*r2-Sigma)*Deltam1Sigmam2; - dst[3][0][2]=dst[3][2][0]= - -4.*spin_*r*(a2_+(-2.+r)*r)*ctgth*Deltam1*Sigmam1*term1m1; + dst[3][0][2]=dst[3][2][0]=-2.*spin_*r*ctgth*Sigmam2; dst[0][3][1]=dst[0][1][3]= - (spin_*(-4.*r6+2.*r4*Sigma-4.*r2*Sigma2+a4_*(-2.*r2+Sigma)+ - 3.*a2_*r2*(-2.*r2+Sigma)-a2_*(a2_+r2)*(2.*r2-Sigma)*c2th)*sth2) - *Deltam1Sigmam2*term1m1; - dst[0][3][2]=dst[0][2][3]= - (spin_*r*(2.*(a4_+2.*r*(2.+r)*Sigma+a2_*(r2+2*Sigma)- - (4.*(a2_+r2)*Sigma*(2.*r+Sigma))*term1m1 - )*s2th-a2_*(a2_+r2)*s4th)) - *0.25*Deltam1Sigmam2; + -spin_*sth2*Deltam1Sigmam2 * (2.*r2*r2plusa2 + Sigma*(r2-a2_)); + dst[0][3][2]=dst[0][2][3]=Sigmam2*spin_*a2_*r*sth2*s2th; dst[0][0][1]=dst[0][1][0]=(a2_+r2)*(2.*r2-Sigma)*Deltam1Sigmam2; - dst[0][0][2]=dst[0][2][0]= - (a2_*r*(-a2_+r*(-r+(4.*Sigma)*term1m1))*s2th)*Deltam1Sigmam2; + dst[0][0][2]=dst[0][2][0]=-a2_*r*s2th*Sigmam2; return 0; } diff -Nru gyoto-1.4.3/lib/Object.C gyoto-1.4.4/lib/Object.C --- gyoto-1.4.3/lib/Object.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/Object.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2014-2016 Thibaut Paumard + Copyright 2014-2016, 2019-2020 Thibaut Paumard This file is part of Gyoto. @@ -28,7 +28,6 @@ #include "GyotoScreen.h" #include -#include using namespace std ; using namespace Gyoto ; @@ -465,7 +464,7 @@ val = size_t(strtoul(content.c_str(), NULL, 0)); break; case Property::double_t: - val = atof(content.c_str()); + val = Gyoto::atof(content.c_str()); set(p, val, unit); return; case Property::filename_t: diff -Nru gyoto-1.4.3/lib/OscilTorus.C gyoto-1.4.4/lib/OscilTorus.C --- gyoto-1.4.3/lib/OscilTorus.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/OscilTorus.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,3 +1,22 @@ +/* + Copyright 2016, 2018-2020 Frederic Vincent & Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + #include "GyotoOscilTorus.h" #include "GyotoFactoryMessenger.h" #include "GyotoUtils.h" @@ -159,8 +178,10 @@ hold_(orig.hold_) { GYOTO_DEBUG << "Copying OscilTorus" << endl; - if (gg_) kerrbl_=SmartPointer(gg_); - gg_->hook(this); + if (gg_) { + kerrbl_=SmartPointer(gg_); + gg_->hook(this); + } } OscilTorus * OscilTorus::clone() const { return new OscilTorus(*this); } diff -Nru gyoto-1.4.3/lib/PageThorneDisk.C gyoto-1.4.4/lib/PageThorneDisk.C --- gyoto-1.4.3/lib/PageThorneDisk.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/PageThorneDisk.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011-2014, 2016, 2018 Frederic Vincent, Thibaut Paumard + Copyright 2011-2014, 2016, 2018-2020 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -78,7 +78,7 @@ spectrumBB_(NULL) { if (o.spectrumBB_()) spectrumBB_=o.spectrumBB_->clone(); - gg_->hook(this); + if (gg_) gg_->hook(this); } PageThorneDisk* PageThorneDisk::clone() const { return new PageThorneDisk(*this); } diff -Nru gyoto-1.4.3/lib/PolishDoughnut.C gyoto-1.4.4/lib/PolishDoughnut.C --- gyoto-1.4.3/lib/PolishDoughnut.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/PolishDoughnut.C 2020-02-28 19:19:43.000000000 +0000 @@ -106,6 +106,7 @@ magnetizationParameter_(-1.), spectral_oversampling_(10), angle_averaged_(0), + bremsstrahlung_(false), deltaPL_(0.), adaf_(0), ADAFtemperature_(0.), diff -Nru gyoto-1.4.3/lib/PowerLawSpectrum.C gyoto-1.4.4/lib/PowerLawSpectrum.C --- gyoto-1.4.3/lib/PowerLawSpectrum.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/PowerLawSpectrum.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011-2012, 2014, 2016, 2019-2020 Thibaut Paumard & Frédéric Vincent This file is part of Gyoto. @@ -21,8 +21,6 @@ #include "GyotoFactoryMessenger.h" #include "GyotoUtils.h" -#include - #include #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" diff -Nru gyoto-1.4.3/lib/PowerLawSynchrotronSpectrum.C gyoto-1.4.4/lib/PowerLawSynchrotronSpectrum.C --- gyoto-1.4.3/lib/PowerLawSynchrotronSpectrum.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/PowerLawSynchrotronSpectrum.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2018 Frederic Vincent, Thibaut Paumard + Copyright 2018-2020 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -20,7 +20,6 @@ #include "GyotoPowerLawSynchrotronSpectrum.h" #include "GyotoDefs.h" #include -#include /* atof */ #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #include "GyotoFactoryMessenger.h" diff -Nru gyoto-1.4.3/lib/RotStar3_1.C gyoto-1.4.4/lib/RotStar3_1.C --- gyoto-1.4.3/lib/RotStar3_1.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/RotStar3_1.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011-2014, 2016, 2018 Frederic Vincent & Thibaut Paumard + Copyright 2011-2014, 2016, 2018-2020 Frederic Vincent & Thibaut Paumard This file is part of Gyoto. @@ -76,14 +76,16 @@ RotStar3_1::~RotStar3_1() { - const Map& mp=star_ -> get_mp(); - const Mg3d* mg=mp.get_mg(); - const Map* mpp=∓ - delete star_; - delete mpp; - delete mg; + if (star_) { + const Map& mp=star_ -> get_mp(); + const Mg3d* mg=mp.get_mg(); + const Map* mpp=∓ + delete star_; + delete mpp; + delete mg; + } - delete [] filename_; + if (filename_) delete [] filename_; if (debug()) cout << "RotStar3_1 Destruction" << endl; } @@ -108,6 +110,7 @@ delete mpp; delete mg; } + if (!lorene_res) return; filename_ = new char[strlen(lorene_res)+1]; strcpy(filename_,lorene_res); diff -Nru gyoto-1.4.3/lib/Scenery.C gyoto-1.4.4/lib/Scenery.C --- gyoto-1.4.3/lib/Scenery.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/Scenery.C 2020-02-28 19:19:43.000000000 +0000 @@ -160,7 +160,7 @@ Scenery::~Scenery() { # if GYOTO_DEBUG_ENABLED - GYOTO_DEBUG << "freeing screen\n"; + GYOTO_DEBUG << "Destroying Scenery\n"; # endif screen_ = NULL; # ifdef HAVE_MPI diff -Nru gyoto-1.4.3/lib/Screen.C gyoto-1.4.4/lib/Screen.C --- gyoto-1.4.3/lib/Screen.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/Screen.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011-2018 Thibaut Paumard, Frederic Vincent + Copyright 2011-2020 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. @@ -24,7 +24,6 @@ #include "GyotoKerrBL.h" #include -#include #include #include #include @@ -1314,7 +1313,8 @@ GYOTO_DEBUG_EXPR(unit); GYOTO_ENDIF_DEBUG # endif - if (name=="Time") {tobs_tmp = atof(tc); tunit=unit; tobs_found=1;} + if (name=="Time") + {tobs_tmp = Gyoto::atof(tc); tunit=unit; tobs_found=1;} else if (name=="Position") { if (FactoryMessenger::parseArray(content, pos, 4) != 4) GYOTO_ERROR("Screen \"Position\" requires exactly 4 tokens"); @@ -1322,12 +1322,12 @@ } else if (name=="Distance") { - scr -> distance ( atof(tc), unit ); + scr -> distance ( Gyoto::atof(tc), unit ); string dmax = fmp -> getAttribute("dmax"); - if (dmax != "") scr -> dMax(atof(dmax.c_str())); + if (dmax != "") scr -> dMax(Gyoto::atof(dmax.c_str())); } else if (name=="FieldOfView") { - fov = atof(tc); fov_unit=unit; fov_found=1; + fov = Gyoto::atof(tc); fov_unit=unit; fov_found=1; } else if (name=="Spectrometer") { scr -> @@ -1336,10 +1336,10 @@ (fmp->getChild(), plugin)); } else if (name=="Dangle1"){ - dangle1 = atof(tc); dangle1_found=1; aunit=unit; + dangle1 = Gyoto::atof(tc); dangle1_found=1; aunit=unit; } else if (name=="Dangle2"){ - dangle2 = atof(tc); dangle2_found=1; dunit=unit; + dangle2 = Gyoto::atof(tc); dangle2_found=1; dunit=unit; } else if (name=="SphericalAngles" || name=="EquatorialAngles" || diff -Nru gyoto-1.4.3/lib/SmartPointer.C gyoto-1.4.4/lib/SmartPointer.C --- gyoto-1.4.3/lib/SmartPointer.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/SmartPointer.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011-2012, 2014, 2020 Thibaut Paumard This file is part of Gyoto. @@ -31,7 +31,9 @@ #endif } -Gyoto::SmartPointee::~SmartPointee() {} +Gyoto::SmartPointee::~SmartPointee() { + GYOTO_DEBUG << typeid(*this).name() << ": refCount=" << refCount << std::endl; +} Gyoto::SmartPointee::SmartPointee(const SmartPointee&o) : refCount (0) @@ -46,6 +48,7 @@ pthread_mutex_lock(&mutex_); #endif refCount++; + GYOTO_DEBUG << typeid(*this).name() << ": refCount=" << refCount << std::endl; #ifdef HAVE_PTHREAD pthread_mutex_unlock(&mutex_); #endif @@ -54,9 +57,11 @@ #ifdef HAVE_PTHREAD pthread_mutex_lock(&mutex_); int n = --refCount; + GYOTO_DEBUG << typeid(*this).name() << ": refCount=" << refCount << std::endl; pthread_mutex_unlock(&mutex_); return n; #else + GYOTO_DEBUG << typeid(*this).name() << ": refCount=" << refCount-1 << std::endl; return --refCount; #endif } diff -Nru gyoto-1.4.3/lib/ThermalBremsstrahlungSpectrum.C gyoto-1.4.4/lib/ThermalBremsstrahlungSpectrum.C --- gyoto-1.4.3/lib/ThermalBremsstrahlungSpectrum.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/ThermalBremsstrahlungSpectrum.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2014-2015, 2018-2019 Frederic Vincent, Thibaut Paumard + Copyright 2014-2015, 2018-2020 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -20,7 +20,6 @@ #include "GyotoThermalBremsstrahlungSpectrum.h" #include "GyotoDefs.h" #include -#include /* atof */ #include /* infinity */ #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" diff -Nru gyoto-1.4.3/lib/ThermalSynchrotronSpectrum.C gyoto-1.4.4/lib/ThermalSynchrotronSpectrum.C --- gyoto-1.4.3/lib/ThermalSynchrotronSpectrum.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/ThermalSynchrotronSpectrum.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2018 Frederic Vincent, Thibaut Paumard + Copyright 2018-2020 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -21,7 +21,6 @@ #include "GyotoDefs.h" #include "GyotoUtils.h" #include -#include /* atof */ #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #include "GyotoFactoryMessenger.h" diff -Nru gyoto-1.4.3/lib/ThickDisk.C gyoto-1.4.4/lib/ThickDisk.C --- gyoto-1.4.3/lib/ThickDisk.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/ThickDisk.C 2020-02-28 19:19:43.000000000 +0000 @@ -34,6 +34,7 @@ #include #include #include +#include using namespace std; using namespace Gyoto; @@ -200,12 +201,42 @@ double temperature = temperatureAtInnerRadius_ *pow(thickDiskInnerRadius_/rr, temperatureSlope_); + double r0 = 4., phi0 = 0., phi = coord_ph[3], + sigr = 2., sigp = M_PI/4.; // spin0: r0=9; spin08: r0=4 + double gaussr = 1./(sqrt(2.*M_PI)*sigr) + * exp(-0.5*(rcyl-r0)*(rcyl-r0)/(sigr*sigr)); + double dphi = fabs(phi-phi0), dphibis = fabs(phi-2.*M_PI-phi0); + if (dphi > dphibis){ + dphi = dphibis; + } + double gaussp = 1./(sqrt(2.*M_PI)*sigp) + * exp(-0.5*dphi*dphi/(sigp*sigp)); + double gauss2d = gaussr*gaussp; + double T0 = 1.6e11; // this is to be tuned: 4e11 too small, 6e11 looks good + double DeltaTemperature = T0*gauss2d; + + //temperature+=DeltaTemperature; + double thetae = GYOTO_BOLTZMANN_CGS*temperature /(GYOTO_ELECTRON_MASS_CGS*GYOTO_C2_CGS); double BB = sqrt(4.*M_PI*magnetizationParameter_ *GYOTO_PROTON_MASS_CGS * GYOTO_C_CGS * GYOTO_C_CGS *number_density); + + double B0 = 100.; // for ne_inner=5.5e4, B_inner=10.2G; B0=50 too small, B0=100 looks good + double DeltaB = B0*gauss2d; + + //BB += DeltaB; + + // // Random generator: mersenne_twister_engine seeded with rd() + // std::random_device rd; + // std::mt19937 generator(rd()); + // // Define a real uniform distribution within some bounds + // std::uniform_real_distribution distribution(0.9,1.1); + // double randnb = distribution(generator); // draw a random number + + //cout << "r ne B= " << coord_ph[1] << " " << number_density << " " << BB << endl; //cout << "r, z, ne, nebase, B, Bbase= " << coord_ph[1] << " " << zz << " " << number_density << " " << baseNumberDensity_cgs_ << " " << BB << " " << sqrt(8.*M_PI*magnetizationParameter_*GYOTO_PROTON_MASS_CGS * GYOTO_C_CGS * GYOTO_C_CGS*baseNumberDensity_cgs_) << endl; //GYOTO_ERROR("testjet"); @@ -310,7 +341,12 @@ void ThickDisk::getVelocity(double const pos[4], double vel[4]) { - double risco = gg_->getRms(); // prograde Kerr ISCO + + double risco = 0.; + if (gg_->kind()!="Minkowski") + risco=gg_->getRms(); // prograde Kerr ISCO + // let risco=0 if metric is Minko; then ISCO not defined + if (pos[1] > risco){ // Keplerian velocity above ISCO gg_ -> circularVelocity(pos, vel, 1); @@ -342,7 +378,7 @@ Vr = (1-Vphi_over_V)*V / sqrt(grr); vel[0] = Gamma*utZAMO; - vel[1] = Gamma*Vr; + vel[1] = -Gamma*Vr; // minus sign coz matter is going towards BH vel[2] = 0.; vel[3] = Gamma*(uphiZAMO + Vphi); diff -Nru gyoto-1.4.3/lib/Utils.C gyoto-1.4.4/lib/Utils.C --- gyoto-1.4.3/lib/Utils.C 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/lib/Utils.C 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011-2012, 2014-2016, 2018-2020 Thibaut Paumard & Frédéric Vincent This file is part of Gyoto. @@ -22,6 +22,7 @@ #include "GyotoPhoton.h" #include #include +#include #include "GyotoScenery.h" #include "GyotoSpectrum.h" @@ -112,7 +113,12 @@ if (positive) retval = DBL_MIN; else retval = -DBL_MIN; } else GYOTO_ERROR("unrecognize double representation"); - } else retval = std::atof(str); + } else { + std::string loc(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); + retval = std::atof(str); + setlocale(LC_NUMERIC, loc.c_str()); + } GYOTO_DEBUG << "==" << retval << endl; diff -Nru gyoto-1.4.3/NEWS gyoto-1.4.4/NEWS --- gyoto-1.4.3/NEWS 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/NEWS 2020-02-28 19:19:43.000000000 +0000 @@ -1,3 +1,12 @@ +1.4.4 2020/02/28 BUG + * Officially drop Python 2.7 support + * Astrobj::ThickDisk: + + Expose in Python + + Minor bugfixes + + Provide example + * Python: fix reference counting issues + * Various minor bug fixes + 1.4.3 2019/10/25 BUG * m4/python.m4: bugfix (actually support Python >=3.8) diff -Nru gyoto-1.4.3/plugins/null/bin/gyoto.in gyoto-1.4.4/plugins/null/bin/gyoto.in --- gyoto-1.4.3/plugins/null/bin/gyoto.in 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/plugins/null/bin/gyoto.in 2020-02-28 19:19:43.000000000 +0000 @@ -3,7 +3,7 @@ export LD_LIBRARY_PATH=@abs_top_srcdir@/lib/.libs:$LD_LIBRARY_PATH export DYLD_LIBRARY_PATH=@abs_top_srcdir@/lib/.libs:$DYLD_LIBRARY_PATH -export GYOTO_PLUGINS=stdplug,nofail:lorene,obspm +export GYOTO_PLUGINS=stdplug,nofail:lorene,null @GYOTO@ $@@ diff -Nru gyoto-1.4.3/plugins/python/ChangeLog gyoto-1.4.4/plugins/python/ChangeLog --- gyoto-1.4.3/plugins/python/ChangeLog 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/plugins/python/ChangeLog 2020-02-28 19:19:43.000000000 +0000 @@ -1,6 +1,161 @@ commit unknown Author: Thibaut Paumard -Date: Tue Oct 25 16:57:04 2019 +0200 +Date: Fri Feb 28 18:40:08 2020 +0100 + + Releasing 1.4.4 + +commit 8042b896850ed0e28d56101d0c574bd530b3bbb9 +Author: Thibaut Paumard +Date: Fri Feb 28 14:03:20 2020 +0100 + + Fix typo refered -> referred + + (cherry picked from commit 034ca81045cd4c1c07a1fab649f0ec52508fca4b) + +commit 68b22662b0188f8cd882180438006a1052276313 +Author: Thibaut Paumard +Date: Thu Feb 27 14:09:39 2020 +0100 + + Python: rework refernce counting issues + + Add test suite for reference counting, modify interface to fix issues + + (cherry picked from commit ec066ab7ba73a88e5fcd0165abf127f9170ee1c3) + +commit a81fed23d0e2eb6adc2d78623c06652b481a5aac +Author: Thibaut Paumard +Date: Thu Feb 27 13:31:53 2020 +0100 + + Python: add gyoto.spectrometer.Uniform = gyoto.spectrometer.UniformSpectrometer + + (cherry picked from commit 6530372e2cef1261ae32d70dbf06a5131db4b5c0) + +commit 03e9aff1c4dc12f25ad0b649a01eb78c0c9aee15 +Author: Thibaut Paumard +Date: Thu Feb 27 13:10:01 2020 +0100 + + Fix classes so cloning always works + + Some classes where expecting to be somehow initialized. + Cloning/printing should always work. + Turn some errors into severe warnings. + + (cherry picked from commit 0c3183059db190e0c67057c71e71d0d44d9a5ec7) + +commit 0c33673c9d7d6106ed0f0444316c7fbb6f582632 +Author: Frederic Vincent +Date: Mon Feb 24 14:32:37 2020 +0100 + + Scenery: correct small typo in print in destructor + + (cherry picked from commit 95204b829f0628f99550e5363f15f8928400bd3c) + +commit 3c3084ed67e37b62690abc983e55bb6ec0109735 +Author: Thibaut Paumard +Date: Tue Feb 18 20:09:09 2020 +0100 + + Factory.C: print Screen section only once + + (cherry picked from commit 7c46c94d8c26ba0c577587cb37c510d6899167f2) + +commit f7ce04b1000032b91aeecb760edcf82622e099e9 +Author: Frederic Vincent +Date: Thu Feb 13 14:03:15 2020 +0100 + + PolishDoughnut: put default bremsstrahlung_ to False + + (cherry picked from commit a4bd341888388e167eb92116c2419c5a33312e9e) + +commit 542208a412c72bf37343178224c893d7ca698c8a +Author: Frederic Vincent +Date: Wed Feb 5 16:39:19 2020 +0100 + + KerrBL: replace christoffels by exactly equivalent expressions, easier to read, tested with SageMath + + (cherry picked from commit 6cad755646222a729ba9446813d2dd7e37de7479) + +commit bbdbb5abcfe76c7e4941babcc837d5b0da1a0a6b +Author: Frederic Vincent +Date: Wed Feb 5 16:24:23 2020 +0100 + + ThickDisk: bug in radial velocity below ISCO corrected + + (cherry picked from commit 4a58ba6a77d5b2a703cfe7c96a697ca9e635c249) + +commit fd48e486da4f560f130b06fb37942a4bc6c55956 +Author: Thibaut Paumard +Date: Tue Feb 4 16:05:51 2020 +0100 + + Always use C locale when writing doubles to XML + + (cherry picked from commit abb343d1e0719329257ca1620d6c276cfa954075) + +commit 6bfeedf07d04e14b4061a474b8bb4c153bec63d1 +Author: Thibaut Paumard +Date: Tue Feb 4 15:20:23 2020 +0100 + + Set LC_NUMERIC to 'C' before calling std::atof + + Gyoto always assumes that decimal_point is '.' and ignore whatever the locale + says. We always set LC_NUMERIC to 'C' in Gyoto::atof. All instances of std::atof + in Gyoto should be replaced by calls to Gyoto::atof. + + (cherry picked from commit bf5b09fc8b1cf5006582cf52bee9a3a77eafb5bc) + +commit 3fc34ec5e5a1bfba54f62c9f19acea1c909ed21c +Author: Frederic Vincent +Date: Thu Jan 30 13:36:55 2020 +0100 + + Expose ThickDisk to python + + (cherry picked from commit 4ade08e5e87451c0f99810b2520ac397bebed951) + +commit 8d9d12407e9371be212b2a720e478c20459f2593 +Author: Frederic Vincent +Date: Thu Jan 23 10:49:52 2020 +0100 + + Adding doc/example/example-thick-disk.xml + + (cherry picked from commit 21e2b8a6b574c81070c95875a55185d843af2e1f) + +commit 9313b41c336e83e2dd745ceaa802bc59028203cf +Author: Eric Gourgoulhon +Date: Thu Jan 23 10:21:42 2020 +0100 + + Small corrections in the install instructions + + (cherry picked from commit c63cb8fdba455df51b3144ae486b8ee66d0d17ff) + +commit ee17672a27e99b814e5e1ced1dd13668ee71545b +Author: Thibaut Paumard +Date: Wed Dec 18 14:13:47 2019 +0100 + + null plugin: load "null", not "obspm". + + (cherry picked from commit 8b76d5495ed53d0f593bc9832c1c4ebcfad4a85f) + +commit 1a14943931b87d3b252e7674bbc437c1c7cfe183 +Author: Thibaut Paumard +Date: Tue Oct 29 14:03:00 2019 +0100 + + Drop Python 2.7 support + + It was lost a some point during summer 2019, and we don't plan on reintroducing it. + + (cherry picked from commit 0fe9301eea584980861576ee8f5b911ea47a893e) + +commit ee6f8e57ad603d2cfe56e0db5eee18a2aaf9bba1 +Author: Frederic Vincent +Date: Mon Nov 18 16:25:43 2019 +0100 + + In ThickDisk.C: adding basic stuff for quick-check + of non-axisymmetric structures + + (cherry picked from commit 00e81b108d634a36f44f3a6ebcda95a905454e09) + +commit 8cd0d5857b92ab43830852a6b29f14a5c5dc514d +Author: Thibaut Paumard +Date: Fri Oct 25 16:59:04 2019 +0200 Releasing 1.4.3 diff -Nru gyoto-1.4.3/plugins/python/configure gyoto-1.4.4/plugins/python/configure --- gyoto-1.4.3/plugins/python/configure 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/plugins/python/configure 2020-02-28 19:19:43.000000000 +0000 @@ -16919,8 +16919,8 @@ for ac_prog in python3 python \ python3 \ - python2 \ - python4.0 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 + \ + python4.0 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 diff -Nru gyoto-1.4.3/plugins/python/configure.ac gyoto-1.4.4/plugins/python/configure.ac --- gyoto-1.4.3/plugins/python/configure.ac 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/plugins/python/configure.ac 2020-02-28 19:19:43.000000000 +0000 @@ -83,7 +83,7 @@ ], []) -PC_PROG_PYTHON([python3], [2.7], [4.0]) +PC_PROG_PYTHON([python3], [3.0], [4.0]) PC_PYTHON_PROG_PYTHON_CONFIG([],[yes]) PC_PYTHON_CHECK_INCLUDES PC_PYTHON_CHECK_HEADERS diff -Nru gyoto-1.4.3/plugins/python/NEWS gyoto-1.4.4/plugins/python/NEWS --- gyoto-1.4.3/plugins/python/NEWS 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/plugins/python/NEWS 2020-02-28 19:19:43.000000000 +0000 @@ -1,3 +1,12 @@ +1.4.4 2020/02/28 BUG + * Officially drop Python 2.7 support + * Astrobj::ThickDisk: + + Expose in Python + + Minor bugfixes + + Provide example + * Python: fix reference counting issues + * Various minor bug fixes + 1.4.3 2019/10/25 BUG * m4/python.m4: bugfix (actually support Python >=3.8) diff -Nru gyoto-1.4.3/python/gyoto/spectrometer.py gyoto-1.4.4/python/gyoto/spectrometer.py --- gyoto-1.4.3/python/gyoto/spectrometer.py 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/python/gyoto/spectrometer.py 2020-02-28 19:19:43.000000000 +0000 @@ -11,3 +11,4 @@ __all__ = _namespaces.make_namespace(Generic, globals()) del _namespaces Complex=ComplexSpectrometer +Uniform=UniformSpectrometer diff -Nru gyoto-1.4.3/python/gyoto.i gyoto-1.4.4/python/gyoto.i --- gyoto-1.4.3/python/gyoto.i 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/python/gyoto.i 2020-02-28 19:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2014-2019 Thibaut Paumard + Copyright 2014-2020 Thibaut Paumard This file is part of Gyoto. @@ -109,8 +109,10 @@ // Include header for a class deriving from SmartPointee, providing // the ref and unref features %define GyotoSmPtrClass(klass) -%feature("ref") Gyoto:: klass "$this->incRefCount();"; -%feature("unref") Gyoto:: klass "$this->decRefCount(); if (!$this->getRefCount()) delete $this;"; +%feature("ref") Gyoto:: klass "$this->incRefCount();//ref"; +%feature("unref") Gyoto:: klass "$this->decRefCount(); if (!$this->getRefCount()) delete $this;//unref"; +// clone() method returns a new object with refCount 0 +%newobject Gyoto :: klass :: clone; %extend Gyoto::klass { std::string __str__() { return Gyoto::Factory($self).format(); @@ -132,8 +134,9 @@ %rename(init ## klass ## Register) Gyoto::klass::initRegister; %rename(get ## klass ## Subcontractor) Gyoto::klass::getSubcontractor; %rename(klass) Gyoto::klass::Generic; -%feature("ref") Gyoto:: klass ::Generic"$this->incRefCount();"; -%feature("unref") Gyoto:: klass ::Generic"$this->decRefCount(); if (!$this->getRefCount()) delete $this;"; +%feature("ref") Gyoto:: klass ::Generic"$this->incRefCount();//ref Generic"; +%feature("unref") Gyoto:: klass ::Generic"$this->decRefCount(); if (!$this->getRefCount()) delete $this;//unref Generic"; +%newobject Gyoto :: klass :: Generic :: clone; // Need to mark the base classes as "notabstract" to extend them with // a down-cast constructor %feature("notabstract") Gyoto::klass::Generic; @@ -150,30 +153,57 @@ %extend Gyoto::klass::Generic { Generic(std::string nm) { std::vector plugin; - Gyoto::SmartPointer pres= - Gyoto::klass::getSubcontractor(nm.c_str(), plugin)(NULL, plugin); - Gyoto::klass::Generic * res = (Gyoto::klass::Generic *)(pres); + Gyoto::klass::Generic * res = NULL; + { + Gyoto::SmartPointer pres= + Gyoto::klass::getSubcontractor(nm.c_str(), plugin)(NULL, plugin); + res = (Gyoto::klass::Generic *)(pres); + // We need to increment refcount, else the object is destroyed + // when the original smartpoiter is: + if (res) res -> incRefCount(); + } + // Now that the original smartpointer has been detroyed, refcount is 1. + // ref feature will increment it again, so we need to decrement is now: + res->decRefCount(); + GYOTO_DEBUG_EXPR(res->getRefCount()); // Special for Uniform spectrometer: // if 'res' can be cast to uniform spectrometer, set Kind. if(dynamic_cast(res)) res->set("Kind", nm); // end special case - if (res) res -> incRefCount(); return res; } Generic(std::string nm, std::vector plugin) { GYOTO_DEBUG_EXPR(plugin.size()); - Gyoto::SmartPointer pres= - Gyoto::klass::getSubcontractor(nm.c_str(), plugin)(NULL, plugin); - Gyoto::klass::Generic * res = (Gyoto::klass::Generic *)(pres); - if (res) res -> incRefCount(); + Gyoto::klass::Generic * res = NULL; + { + Gyoto::SmartPointer pres= + Gyoto::klass::getSubcontractor(nm.c_str(), plugin)(NULL, plugin); + res = (Gyoto::klass::Generic *)(pres); + // We need to increment refcount, else the object is destroyed + // when the original smartpoiter is: + if (res) res -> incRefCount(); + } + // Now that the original smartpointer has been detroyed, refcount is 1. + // ref feature will increment it again, so we need to decrement is now: + res->decRefCount(); + GYOTO_DEBUG_EXPR(res->getRefCount()); + // Special for Uniform spectrometer: + // if 'res' can be cast to uniform spectrometer, set Kind. + if(dynamic_cast(res)) + res->set("Kind", nm); + // end special case return res; } Generic(long address) { Gyoto::klass::Generic * res = (Gyoto::klass::Generic *)(address); - if (res) res -> incRefCount(); + // Should be done by ref feature: + // if (res) res -> incRefCount(); return res; } + Generic(Gyoto::klass::Generic *orig) { + return orig; + } std::string __str__() { return Gyoto::Factory($self).format(); } @@ -189,6 +219,7 @@ // e.g. cplx=gyoto_std.ComplexAstrobj(sc.strobj()) %define GyotoSmPtrClassDerivedPtrHdr(nspace, klass, nick, hdr) %rename(nick) Gyoto::nspace::klass; +%newobject Gyoto :: nspace:: klass :: clone; %feature("notabstract") Gyoto::nspace::klass; %extend Gyoto::nspace::klass { klass(Gyoto::nspace::Generic * base) { @@ -198,7 +229,8 @@ } klass(long address) { Gyoto::nspace::klass * res = (Gyoto::nspace::klass *)(address); - if (res) res -> incRefCount(); + // Should be done by ref feature: + // if (res) res -> incRefCount(); return res; } }; @@ -538,6 +570,7 @@ %include "GyotoDefs.h" // Expose the Gyoto::Error class +// Not a SmartPointee %extend Gyoto::Error { const char *__str__() { return *($self); @@ -549,6 +582,8 @@ // Expose the SmartPointer API %ignore Gyoto::SmartPointer::operator(); %rename(assign) Gyoto::SmartPointer::operator=; +%feature("ref") Gyoto::SmartPointee "$this->incRefCount();//ref SmartPointee"; +%feature("unref") Gyoto::SmartPointee "$this->decRefCount(); if (!$this->getRefCount()) delete $this;//unref SmartPointee"; %include "GyotoSmartPointer.h" // Expose Gyoto::Register::list as gyoto.listRegister @@ -557,14 +592,19 @@ %rename(listRegister) Gyoto::Register::list; %include GyotoRegister.h + +// Not a SmartPointee %rename(Functor__Double_constDoubleArray) Gyoto::Functor::Double_constDoubleArray; %rename(Functor__Double_Double_const) Gyoto::Functor::Double_Double_const; %include "GyotoFunctors.h" +// Not a SmartPointee %include "GyotoHooks.h" +// Not a SmartPointee %include "GyotoWIP.h" +// Worldline: not a SmartPointee %immutable Gyoto::Value::type; %rename(assign) Gyoto::Value::operator=; %rename(toDouble) Gyoto::Value::operator double; @@ -699,10 +739,25 @@ GyotoSmPtrClassGeneric(Spectrum) GyotoSmPtrClassGeneric(Spectrometer) + +%inline { + class myCplxSpectroIdxExcept {}; +} + +%exception Gyoto::Spectrometer::Complex::__getitem__ { + try { + $action ; + } catch (myCplxSpectroIdxExcept e) { + SWIG_exception_fail(SWIG_IndexError, "Index out of bounds"); + } +} + %extend Gyoto::Spectrometer::Complex { - Gyoto::Spectrometer::Generic * __getitem__ (int i) { - Gyoto::Spectrometer::Generic * res = ($self)->operator[](i); - if (res) res -> incRefCount(); + Gyoto::SmartPointer __getitem__ (size_t i) { + if (i >= ($self)->getCardinal()) { + throw myCplxSpectroIdxExcept(); + } + Gyoto::SmartPointer res = ($self)->operator[](i); return res; } }; @@ -714,8 +769,13 @@ GyotoSmPtrClassDerivedPtrHdr(Spectrometer, Complex, ComplexSpectrometer, GyotoComplexSpectrometer.h) GyotoSmPtrClassDerivedPtrHdr(Spectrometer, Uniform, UniformSpectrometer, GyotoUniformSpectrometer.h) +// Not a class %include "GyotoConfig.h" + +// Not a class %include "GyotoUtils.h" + +// Not a SmartPointee %include "GyotoFactory.h" // Backwards-compatibility code introduced 2018-10-04 @@ -730,6 +790,7 @@ } }; +// Not a SmartPointee %include "GyotoFactoryMessenger.h" // SWIG fails on nested classes. Work around this limitation: @@ -901,16 +962,26 @@ double angle() const ; }; +// Not a SmartPointee %ignore Gyoto::Property::Property; %include "GyotoProperty.h" +// Units and Converters are SmartPointee %extend Gyoto::Units::Unit { const char *__str__() { return (std::string(*($self))).c_str(); } }; +%feature("ref") Gyoto::Units::Unit "$this->incRefCount();//ref Unit"; +%feature("unref") Gyoto::Units::Unit "$this->decRefCount(); if (!$this->getRefCount()) delete $this;//unref Unit"; +%feature("ref") Gyoto::Units::Converter "$this->incRefCount();//ref Converter"; +%feature("unref") Gyoto::Units::Converter "$this->decRefCount(); if (!$this->getRefCount()) delete $this;//unref Converter"; %include "GyotoConverters.h" +// not a SmartPointee +%include "GyotoGridData2D.h" + + // Workaround cvar bug in Swig which makes help(gyoto) fail: %inline { namespace Gyoto { @@ -918,4 +989,3 @@ } int Gyoto::__class__ = 0; } -%include "GyotoGridData2D.h" diff -Nru gyoto-1.4.3/python/gyoto_std.i gyoto-1.4.4/python/gyoto_std.i --- gyoto-1.4.3/python/gyoto_std.i 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/python/gyoto_std.i 2020-02-28 19:19:43.000000000 +0000 @@ -75,6 +75,7 @@ GyotoSmPtrTypeMapClassDerived(Astrobj, Jet) GyotoSmPtrTypeMapClassDerived(Astrobj, Blob) GyotoSmPtrTypeMapClassDerived(Astrobj, FlaredDiskSynchrotron) +GyotoSmPtrTypeMapClassDerived(Astrobj, ThickDisk) GyotoSmPtrTypeMapClassDerived(Metric, KerrBL) GyotoSmPtrTypeMapClassDerived(Metric, KerrKS) @@ -107,12 +108,11 @@ } %extend Gyoto::Astrobj::Complex { - Gyoto::Astrobj::Generic * __getitem__ (size_t i) { + Gyoto::SmartPointer __getitem__ (size_t i) { if (i >= ($self)->getCardinal()) { throw myCplxIdxExcept(); } - Gyoto::Astrobj::Generic * res = ($self)->operator[](i); - res -> incRefCount(); + Gyoto::SmartPointer res = ($self)->operator[](i); return res; } }; @@ -147,6 +147,7 @@ GyotoSmPtrClassDerived(Astrobj, Jet) GyotoSmPtrClassDerived(Astrobj, Blob) GyotoSmPtrClassDerived(Astrobj, FlaredDiskSynchrotron) +GyotoSmPtrClassDerived(Astrobj, ThickDisk) diff -Nru gyoto-1.4.3/python/gyoto_std_swig.h gyoto-1.4.4/python/gyoto_std_swig.h --- gyoto-1.4.3/python/gyoto_std_swig.h 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/python/gyoto_std_swig.h 2020-02-28 19:19:43.000000000 +0000 @@ -15,6 +15,7 @@ #include "GyotoTorus.h" #include "GyotoOscilTorus.h" #include "GyotoThinDisk.h" +#include "GyotoThickDisk.h" #include "GyotoPageThorneDisk.h" #include "GyotoThinDiskPL.h" #include "GyotoPolishDoughnut.h" diff -Nru gyoto-1.4.3/python/tests/core.py gyoto-1.4.4/python/tests/core.py --- gyoto-1.4.3/python/tests/core.py 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/python/tests/core.py 2020-02-28 19:19:43.000000000 +0000 @@ -3,9 +3,104 @@ import unittest import gyoto.core import numpy +import gyoto.metric, gyoto.astrobj, gyoto.spectrum, gyoto.spectrometer +import inspect gyoto.core.requirePlugin('stdplug') +class TestSmartPointer(unittest.TestCase): + def test_simple_classes(self): + for classname in ('Scenery', 'Screen', 'Photon'): + cls=getattr(gyoto.core, classname) + obj=cls() + self.assertEqual(obj.getRefCount(), 1) + clone=obj.clone() + self.assertEqual(obj.getRefCount(), 1) + self.assertEqual(clone.getRefCount(), 1) + rep=obj.__str__() + self.assertEqual(obj.getRefCount(), 1) + + def test_base_classes(self): + '''Test reference counting + + All constructors, cloners and destructors must implement and + decrement the reference counter correctly. + + ''' + for gnspace in ('Metric', 'Astrobj', 'Spectrum', 'Spectrometer'): + pnspace=gnspace.lower() + nspace=getattr(gyoto, pnspace) + generic=getattr(nspace, 'Generic') + for classname, cls in inspect.getmembers(nspace): + # Skip abstract classes + if (classname in ('Generic', + gnspace, + 'StandardAstrobj', + 'UniformSphere') + or not inspect.isclass(cls)): + continue + # The XML name of ComplexAstrobj et al. is 'Complex' + if 'Complex' in classname: + classname='Complex' + # The XML name of UniformSpectrometer is 'wave' + if classname in ('UniformSpectrometer', 'Uniform'): + classname='wave' + # Construct instance from default constructor + obj=cls() + self.assertEqual(obj.getRefCount(), 1) + # Cast to base class + gen=generic(obj) + self.assertEqual(obj.getRefCount(), 2) + # Destroy one reference + del gen + self.assertEqual(obj.getRefCount(), 1) + # Clone + clone=obj.clone() + self.assertEqual(obj.getRefCount(), 1) + self.assertEqual(clone.getRefCount(), 1) + # Print + rep=obj.__str__() + self.assertEqual(obj.getRefCount(), 1) + # Clean + del rep + del clone + del obj + # Construct instance from XML name + gen=generic(classname) + self.assertEqual(gen.getRefCount(), 1) + # Cast to derived class + obj=cls(gen) + self.assertEqual(gen.getRefCount(), 2) + # Destroy one isntance + del obj + self.assertEqual(gen.getRefCount(), 1) + # Clean + del gen + # Construct instance from XML name, setting plugin list + gen=generic(classname, []) + self.assertEqual(gen.getRefCount(), 1) + # Clean + del gen + + def test_complex_classes(self): + '''Test that adding, retrieving, deleting members updates refCount + ''' + for cls in (gyoto.astrobj.Complex, gyoto.spectrometer.Complex): + cplx=cls() + cplx1=cls() + self.assertEqual(cplx.getRefCount(), 1) + self.assertEqual(cplx1.getRefCount(), 1) + cplx.append(cplx1) + self.assertEqual(cplx1.getRefCount(), 2) + cplx2=cplx[0] + self.assertEqual(cplx1.getRefCount(), 3) + del cplx2 + self.assertEqual(cplx1.getRefCount(), 2) + cplx.remove(0) + self.assertEqual(cplx1.getRefCount(), 1) + del cplx1 + del cplx + class TestUnit(unittest.TestCase): def test___str__(self): diff -Nru gyoto-1.4.3/README.Developers gyoto-1.4.4/README.Developers --- gyoto-1.4.3/README.Developers 2019-10-25 14:59:04.000000000 +0000 +++ gyoto-1.4.4/README.Developers 2020-02-28 19:19:43.000000000 +0000 @@ -70,4 +70,25 @@ * Take a coffee break. +Coding rules: +============= + +Don't use std::atof from cstdlib. Use Gyoto::atof instead. Gyoto::atof +is a wrapper that ensures demical_point is "." and handles special +values like DBL_MAX. + +On output (especially to XML), you should also make sure to use the +'C' locale. If using C-style sprintf(), this can be done with: + #include + std::string loc(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); + sprintf(txt, fmt, val); + setlocale(LC_NUMERIC, loc.c_str()); +If using C++-style streams: + #include + std::locale Cloc("C"); + ostringstream ss; + ss.imbue(Cloc); + ss << val; + Regards, Thibaut.