Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#15261 closed defect (fixed)

Fix brian optional spkg for new workflow

Reported by: kcrisman Owned by:
Priority: major Milestone: sage-5.13
Component: packages: optional Keywords:
Cc: uri, vbraun Merged in:
Authors: Karl-Dieter Crisman Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by vbraun)

See #14962. We have to either fix the newest version checking in brian or (better) get rid of it completely.

This would be an ideal time to upgrade brian to a new version and use the patch file instead of the py file for the one fix that is in it.

Updated spkg:

Change History (9)

comment:1 Changed 6 years ago by kcrisman

Here's my current diff. I won't have time to upgrade and test today, but hopefully tomorrow. Note that

$ diff -Naur src/brian/units.py patches/units.py

actually returns a lot of whitespace changes so this is better from that standpoint as well.

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    3131
    3232== Changelog ==
    3333
     34=== brian-1.2.1.p1 (Karl-Dieter Crisman, 7 October 2013) ===
     35 * Change spkg-install for transition to git
     36
    3437=== brian-1.2.1.p0 (Oriol Castejon, 3rd August 2010) ===
    3538 * Version for Sage of the Python package Brian released.
    36 
    3739 * Minor change added to avoid problems with Brian units and Sage Integers and
    3840   RealNumbers.
    3941
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    66   exit 1
    77fi
    88
    9 ############################## Check dependencies ##############################
    10 NUMPY=`cd $SAGE_ROOT/spkg/standard/; ./newest_version numpy`
    11 if [ $? -ne 0 ]; then
    12     echo "Failed to find numpy.  Please install the numpy spkg."
    13     exit 1
    14 fi
     9cd src
    1510
    16 SCIPY=`cd $SAGE_ROOT/spkg/standard/; ./newest_version scipy`
    17 if [ $? -ne 0 ]; then
    18     echo "Failed to find scipy.  Please install the scipy spkg."
    19     exit 1
    20 fi
    21 
    22 MATPLOTLIB=`cd $SAGE_ROOT/spkg/standard/; ./newest_version matplotlib`
    23 if [ $? -ne 0 ]; then
    24     echo "Failed to find matplotlib.  Please install the matplotlib spkg."
    25     exit 1
    26 fi
    27 
    28 SYMPY=`cd $SAGE_ROOT/spkg/standard/; ./newest_version sympy`
    29 if [ $? -ne 0 ]; then
    30     echo "Failed to find sympy.  Please install the sympy spkg."
    31     exit 1
    32 fi
    33 ################################################################################
    34 
    35 
    36 ################################ Apply patches #################################
    37 cp patches/units.py src/brian/units.py
    38 if [ $? -ne 0 ]; then
    39     echo "Error copying patch."
    40     exit 1
    41 fi
    42 ################################################################################
    43 
    44 cd src
     11# Apply patch so that Sage reals and integers do not conflict
     12for patch in ../patches/*.patch; do
     13   patch -p1 <"$patch"
     14   if [ $? -ne 0 ]; then
     15       echo "Error applying '$patch'."
     16       exit 1
     17   fi
     18done
    4519
    4620python setup.py build
    4721if [ $? -ne 0 ]; then

I may have to change the p1 to something else or change the patch file slightly.

Last edited 6 years ago by kcrisman (previous) (diff)

comment:2 Changed 6 years ago by kcrisman

I do get

sage: import brian
.../sage-5.11.rc0/local/lib/python2.7/site-packages/brian/utils/sparse_patch/__init__.py:34: UserWarning: Couldn't find matching sparse matrix patch for scipy version 0.12.0, but in most cases this shouldn't be a problem.
  warnings.warn("Couldn't find matching sparse matrix patch for scipy version %s, but in most cases this shouldn't be a problem." % scipy.__version__)

Presumably an upgrade would fix this - e.g. 1.4.1, which seems to be most recent.

comment:3 Changed 6 years ago by kcrisman

  • Description modified (diff)

I have two different ones to try. I think I got the patches right for the upgrade. Oriol, can you check that this still works for your clash issue with Sage-defined types?

comment:4 Changed 6 years ago by kcrisman

  • Authors set to Karl-Dieter Crisman
  • Status changed from new to needs_review

comment:5 Changed 6 years ago by vbraun

  • Description modified (diff)
  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Looks good to me. I've repacked it with gnu tar instead of bsd tar, no other changes.

comment:6 Changed 6 years ago by jdemeyer

  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:7 Changed 6 years ago by kcrisman

Closed... Presumably this still needs to be uploaded to the server, though?

comment:8 follow-up: Changed 6 years ago by jdemeyer

I surely see brian-1.4.1.p0 on optional packages.

comment:9 in reply to: ↑ 8 Changed 6 years ago by kcrisman

I surely see brian-1.4.1.p0 on optional packages.

Sorry, I didn't even look - usually I see an announcement here or only after the release (here, apparently 5.13) is actually released. But if it was earlier, great!

Note: See TracTickets for help on using tickets.