That would be a nice addition indeed! test
|
|
I would like better support (well, some support, really) for SparseArray s and String s in Compile ; being able to compile recursive functions would be a nice bonus as well.
|
|
I'm pretty sure recursive functions can be handled. Probably needs the three argument form of Compile that in effect declares the return type.
|
|
I would like to have separate functions for testing whether a graph has edge weights or vertex weights. WeightedGraphQ returns True for both. Working with properties (PropretyList , PropertyValue , etc.) is at the moment unreliable so I am not sure what is a robust way to test for this using properties that won't fail in any situation.
|
|
Why PropertyValue is unreliable? Show example please. It's interesting.
EdgeWeightQ[g_]:=!SameQ[PropertyValue[g,EdgeWeight],Automatic]
VertexWeightQ[g_]:=!SameQ[PropertyValue[g,VertexWeight],Automatic]
g=Graph[{1<->2,2<->3,3<->1},EdgeWeight->RandomInteger[5,3]];
{WeightedGraphQ[g],EdgeWeightQ[g],VertexWeightQ[g]}
{True,True,False}
g=Graph[{1<->2,2<->3,3<->1},VertexWeight->RandomInteger[5,3]];
{WeightedGraphQ[g],EdgeWeightQ[g],VertexWeightQ[g]}
{True,False,True}
|
|
One example: try your function on Graph[{}, {}] . Yes, this is what I am using right now: WeightedGraphQ[g] && PropertyValue[g, EdgeWeight] =!= Automatic . But given the myriads of problems with properties I have no confidence whatsoever that this won't break in some situation. Also note that it is not documented what PropertyValue[g, EdgeWeight] should return for an unweighted graph, so how do I know that this implementation will always work? There are countless weird bugs with properties, I can't even keep track of them. To tease them out, try the following things: set various properties such as EdgeWeight, EdgeCapacity, VertexWeight, VertexCoordinates on a graph, then set it again on the result. This fails the second time in some cases unless using very specific syntax: SetProperty[g, VertexCoordinates -> { vertexName -> coord}] instead of SetProperty[g, VertexCoordinates -> {coord}] . Then try setting properties with the alternative Graph[g, EdgeWeights -> ...] syntax, which sometimes fails even though SetProperty works. SetProperty[KaryTree[63], EdgeWeight -> RandomReal[1, 62]] works. Graph[KaryTree[63], EdgeWeight -> RandomReal[1, 62]] fails. Graph[RandomGraph[{20, 62}], EdgeWeight -> RandomReal[1, 62]] works. Graph[Uncompress@Compress@KaryTree[63], EdgeWeight -> RandomReal[1, 62]] works again
Then try setting properties, then deleting or adding edges or vertices. Try different combinations such as adding vertices with EdgeAdd instead of VertexAdd , i.e. EdgeAdd[Graph[{1,2}, {1<->2}], {2<->3}] . Try running various functions on the result. Even when the property setting appears to work, in past versions it has happened that the graph got corrupted internally in some subtle way so certain things didn't work on it anymore (or even crashed the kernel). I don't know which of these are fixed (one crash I knew about was fixed). In general I have little faith left in the property framework, and currently I can find no clear way, purely based on documented features, to test whether a graph has edge weights. I guess a promise (in the documentation) that PropertyList[g] will never contain EdgeWeight for non-edge-weighted graphs and will always contain it for edge-weighted ones would be sufficient. I don't actually need separate functions.
|
|
Hah! EdgeWeightQ and VertexWeightQ are True for Graph[{}, {}]. Really there are a lot of weird bugs. It's interesting to know. Thank you!
|
|
It would be nice to see implementation of Hidden semi-Markov model: functions HiddenSemiMarkovProcess and FindHiddenSemiMarkovStates .
|
|
I would like to see the following improvements to DendrogramPlot (from the HierarchicalClustering standard add-on):
- ability highlight the lines of the dendrogram plot instead of the background (see
HighlightLevel and HighlightStyle )
- ability to use different colours for each cluster, i.e. here the two separate green parts should have different colours
- ability to also highlight the leaf labels according to which cluster they are in (
HighlightLevel ), without needing to do additional manual work
In general, it would be nice if this function were on part with MATLAB's version. MATLAB also supports optimizing the leaf order.
|
|
A neat way to extract properties from sound objects, such as sample rate, list of samples, etc.
|
|
This can now be done using the Audio framework:
AudioSampleRate
AudioData
|
|
Yeah. I was happy with this.
|
|
A function to convert quantities to prefixed units such that the magnitude is between 1 and 1000. So, 0.023V would be 23mV, 2.7*^4 ohm would be 27 kiloohm, etc.
|
|
I would like SemanticImport to support data tables with both column and row labels. A CSV could look like
,A,B
C,1,2
D,3,4
where A and B are column labels and C and D are row labels. It already supports data with only column labels quite well.
If this feature is added, it would be useful to be able to trigger it manually (instead of fully relying on automatic detection). I know that this simple example I showed could be read as SemanticImportString[..., {"String", "Number", "Number"},
HeaderLines -> 1] (with a bit of post-processing), but this sort of data tends to have a large number of columns instead of just a few. Also the number of columns might not be known ahead of time (unless I count manually). I'm hoping for something that can easily handle a 500 by 500 table with row and column labels. In some fields it is common to have data in this format for (dense, weighted) adjacency matrices, and the vertex labels are very important. While it would be better to distribute this sort of data in a proper graph-oriented format, that is not what is happening in practice and that's not what I need to deal with.
|
|
"HeaderColumns" -> n would be useful indeed!
|
|
I would like to see method "ConvolutionalNeuralNetwork" in Classify. I know that ImageIdentify is based on CNN, but I would like to train CNN on my own images. Also I would like to see improvements of documentation for Predict and Classify - there are a lot of undocumented functionality. For example: {"NeuralNetwork", "HiddenLayers"-> {{4, "RectifiedLinear"}, {3, "Tanh"}, 3}} and all supported layers are {"LogisticSigmoid", "RectifiedLinear", "Tanh", "SoftRectifiedLinear", "Linear"} Currently I need searching such information using Options or on the StackExchange.
|
|
List needs 24 bytes to store values in it.
ByteCount@{}
40
ByteCount@{1}
64
I would like to see IntegerArray, RealArray, ComplexArray in analog of existing ByteArray and undocumented RawArray. But also I would like to see overloading of all operators (+, -, *, /) and support in all functions (Min, Max etc.) Examples:
ByteArray[{1,2}] + ByteArray[{3,4}] = ByteArray[{4,6}]
ByteArray[{1,2}] + 1 = ByteArray[{2,3}]
ByteArray[{1,2}] + 1.0 = RealArray[{2.0,3.0}]
|
|
If you are looking for efficient storage and better performance, then this is already available as packed arrays:
Packed arrays work transparently with many different functions and are meant for numerical computation.
|
|
Thank you. I know about PackedArrays but my idea is little bit different.
ByteCount@ToPackedArray[{}]
40
ByteCount@ToPackedArray[{1}]
112
RawArray supports array types {SignedInteger8, Byte, SignedInteger16, Bit16, SignedInteger32, UnsignedInteger32, SignedInteger64, Real32, Real, Complex128} ByteArray is equivalent to RawArray["Byte",data]. Overhead is different but the size of one data object is 1 byte. I would like to see simular functionality for integers and reals. And operators overloading as for PackedArrays.
ToPackedArray[{1, 2, 3}] + 1
{2, 3, 4}
Not this:
ByteArray[{1, 2, 3}] + 1
1 + ByteArray[< 3 >]
|
|
Packed arrays do store data efficiently: 8 bytes for an Integer (4 bytes on 32 bit systems) and 8 bytes for a Real. What you are seeing when you measure an empty array is a small constant overhead and possibly some inaccuracies in how ByteCount reports (?). Try measuring a much larger array to see this.
|
|
You are right, packed arrays do store data efficiently. WRI integrates multiple functions from the packages into the kernel. ByteArray was introduced in 10.1 but it doesn't support addition, multiplication as the packed arrays. My idea is to make operators overloading and integrate RealArray and IntegerArray into the kernel. Now of course I can use packed arrays from the "Developer`" package.
|
|
Sorry, I still don't understand what functionality you are expecting from such a "RealArray" that packed arrays don't already do. Packed arrays are not provided by any package, they are integrated into the kernel. Developer` is just a context containing some functions, not a package. They couldn't possibly be provided by a package and still have such a deep level of integration: packed arrays are the basic data structure for compiled functions and LibraryLink too; automatic and transparent packed array handling is the reason why Mathematica can be fast with numerical computations on large arrays. Adding arithmetic for ByteArrays is of course something different and unrelated. That's something Mathematica doesn't currently have.
|
|
When I was writing my post, I thought about RawArrays and different types and sizes of data for using the memory even more efficiently than with the packed arrays: SignedInteger8, SignedInteger16 etc. But you are right, packed arrays are sufficiently effective. WRI can register only the one wish: "Adding arithmetic for ByteArrays" P.S.: sorry for my English
|
|
- Operator form of
GatherBy
- Operator form of
Nest
Operator form of Fold (now available in Version 11)
|
|
Operator form of StringMatchQ and the like would be great, too.
|
|
This has been added in 10.4 (or perhaps a version before that?)
|
|
I would like to see the following functionality to improve Mathematica's capabilities for data science and numerics 1) Algorithmic Differentiation (also known as Automatic Differentiation) functionality. 2) More functions that are Compilable. In particular, functionality that has no symbolic use, such as random deviates from distributions can be made compilable so that simulation based inference can be fast. In fact, Mathematica was way ahead of other languages (Julia, Python etc. ) in terms of JIT compilation and compilation options to C, but somehow has not been able to fully leverage this advantage.
|
|
I'd like to see Random Correlation and Covariance matrices. With RLink, the need for this functionality is somewhat reduced, since R has its "clusterGeneration" package that does this, but, still, it would be very useful to have this as built in Mathematica functionality. One could combine the results from this function with things such as MultinormalDistribution to produce populations with correlated features (just as in real life). Possible usage
Options[RandomCorrelationMatrix] ={Method->"Onion",
CorrelationDistribution->TransformedDistribution[Rescale[x,{0,1},{-1,1}],Distributed[x,BetaDistribution[1,1]]}
RandomCorrelationMatrix[d_Integer,OptionsPattern[]]
|
|
The command completion has a preference setting: "Match case in command completion". I switched this one off.
But it does autocomplete (show suggestions) when I type Ran but not when I type ran , can someone confirm? Is this as intended? Or is this only for options? I'd like a feature request for also command completion for that... This setting seems to be gone now.
|
|
I would like to see more consistent colour schemes between different plotting functions. The default is yellow, blue, green for some, but it's blue, yellow, green for others. Now suppose I'm in a discussion with someone and I need to show them some ideas quickly. I make a few plots, always using the data variables in the same order, but they get confused and annoyed:
So is the "foo" yellow and the "bar" blue or is it the reverse? But in the other figure it was the opposite! Why can't you just keep it consistent?
|
|
Wow! I never noticed!! crazy indeed! But they appear to be based around:
ColorData[97] /@ Range[3]
Which the Plot function uses, but the other swap them somehow?! I would almost call it a bug...
|
|
I have typed Range[Length[x]] a zillion times in my Mathematica life. It would be nice to have a function RangeLength[x] that did the same thing. I suppose it could be named IntegerCorrespondence[x,seq_:{1,1}] so that if we wrote
IntegerCorrespondence[{"apples","bananas","fruits"},{3,2}]
we would get {3,5,7} or if we wrote
IntegerCorrespondence[{"apples","bananas","fruits"}]
we would get {1,2,3}
|
|
Isn't it just as easy, or even shorter, to type Range@Length[...] ? Or if there's a need to refer to the function without calling it then Range@*Length . The same goes for Reverse@Sort .
|
|
@Sazabolcs that is a good suggestion. I always do this and add also CTRL + Q to Quit current kernel.
|
|
I would like to see builtin keyboard shortcuts for entering \[LeftDoubleBracket] and \[RightDoubleBracket] . The first thing I do after installing Mathematica is adding these shortcuts to KeyEventTranslations.tr. This is of course unsupported, and unfortunately in 10.2 the same shortcuts I used to use are now assigned to something else. These characters improve the readability of code significantly and having a shortcut for them would be a great improvement. Esc [[ Esc is just unrealistically slow to type.
|
|
I would like to have Mathematica to convert [[ to \[LeftDoubleBracket] while you type. Just as it does it for -> to a \[Rule] . No need for special short keys! Just a checkbox in the preferences would be nice.
|
|
That might be a problematic thing to implement in a non-annoying way because the system can't tell for sure what you mean when you are typing the closing ]] . Is it ] ] or a double bracket? It would have to match the opening one, of course, but during editing things don't always match perfectly.
|
|
Indeed some checking is necessary. But I think this mechanism is already in place, also for the -> combination: it only appears after you type another character after it...
|
|
What they could do is: If you type a ] character check is there is a [[ ]] pair (where the last brackets of these 4 was the last character typed) and then replace both at the same time...
|
|
Integrate[f,x,y];
Integrate[f,x,y,z];
for Integrate[Integrate[f,x],y] ...
This usage works already but is missing in the documentation. When Integrate is used as an indefinite integral it is, of course, an inverse operation to the differentiation D. Just as D[f,x,y] makes sense (and is documented), Integrate[f,x,y] makes sense too and should be documented. For all functions f which allow to find Integrate[f,x,y] one has an exact formula for
Integrate[f,{x,y} el Rectangle[{x0,y0},{x1,y1}]
(not clear why Esc el Esc does not work for the set element symbol). So it should not happen, as it does for
Integrate[1/Sqrt[r*r + x*x + y*y], x, y]
-x + r ArcTan[x/r] - r ArcTan[(x y)/(r Sqrt[r^2 + x^2 + y^2])] +
y Log[x + Sqrt[r^2 + x^2 + y^2]] + x Log[y + Sqrt[r^2 + x^2 + y^2]]
rec = Rectangle[{-1, -1}, {1, 1}]
Integrate[1/Sqrt[x*x + y*y + z*z], {x, y} \[Element] rec]
\!\(\*UnderscriptBox[\(\[Integral]\), \({x, y} \[Element]
Rectangle[{\(-1\), \(-1\)}, {1, 1}]\)]\)1/Sqrt[x^2 + y^2 + z^2]
that the two-fold indefinite integral can be done and the definite integral over a rectangle remains unevaluated.
Here the case of two variables was taken as a pattern for any number of variables.
|
|
Mutze, I am not sure I understand - does not this already work?
Integrate[4 x y, x, y]
x^2 y^2
Also for your tougher example:
rec = Rectangle[{-1, -1}, {1, 1}];
FullSimplify[PowerExpand[Integrate[1/Sqrt[r + x^2 + y^2],
{x, y} \[Element] rec, GenerateConditions -> False]]]
|
|
Dear Sam,
thank you for your solution. I have to learn this: whenever a Mathematica function does not work as expected, look for the available options. They may make the thing work. In the case of my example this was the 'GenerateConditions -> False' option.
Perhaps the documentation should indicate that this option may make the difference between failure and success.
That the many arguments syntax really works for Integrate was already stated in my request.
My point concerning missing documentation concerning this variant seems still be valid.
|
|
Export[blahblah, "Markdown"]
Import[blahblah,"Markdown"]
Markdown is being used A LOT these days in languages such as R. There are many things one can do with Markdown text that are difficult in the Mathematica front end and, it would be useful to be able to work more seamlessly between Mathematica and things like Project Jupyter. By way of example Export[ Cell[TextData[{
"This is a ",
StyleBox["very ",
FontSlant->"Italic"],
StyleBox["interesting ",
FontWeight->"Bold"],
"idea. "
}], "Text",
CellChangeTimes->{{3.651086579454398^9, 3.651086616516877^9}}],"Markdown"] might yield something like
This is a *very* **interesting** idea.
And something like this Export[ Cell[BoxData[
RowBox[{"Solve", "[",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"a", " ",
SuperscriptBox["x", "2"]}], "+", " ", "bx", " ", "+", "c"}], "==", "0"}], ",", "x"}],
"]"}]], "Input",
CellChangeTimes->{{3.651086627422246^9, 3.651086642785838^9}}],"Markdown"] might yield something like
\text{Solve}\left[a x^2+\text{bx}+c=0,x\right]
With the answer looking like this
\
$\left\{\left\{x\to
-\frac{\sqrt{-\text{bx}-c}}{\sqrt{a}}\right\},\left\{x\to \frac{\sqrt{-\text{bx}-c}}{\sqrt{a}}\right\}\right\}\$
(By the way, in writing this comment up, I realized that the editor actually has the ability to translate out of LaTeX and Markdown. Cool. Anyway, this idea is rather inchoate, but Mathematica and its Front End ought to play better with Markdown.
|
|
NashEquilbrium
NashEquilibriumStrategies
NashEquilibriumValues
These functions would take a strategic (normal) form game and yield an Association which held the equilbrium strategies (both pure and mixed) and the values to the players from playing that strategy. It would work on symbolic games i.e. where the payoffs were symbols and not numbers ) by returning a Piecewise function (or something similar) showing the logical conditions under which each of the strategies would be a Nash equilibrium. The function would work for n-player games. This function would need some specification of a data structure to represent a game. Might be done via a mapping of strategy combinations onto values, some sort of tabular structure, or in some other way. It would also have a nice printout of the game in bimatrix form (for two player games) or in a list of matrices for n-player games. I recognize this is a non-trivial undertaking. I am basically asking for a development project as much as a function, but I still think it would be a good idea. (There's a now-very old package out of New Zealand that has some of this functionality, but it needs a lot more development.)
|
|
ReverseSort
ReverseSortBy
Now, obviously one can code this oneself either through wrapping the Sort in Reverse or by using a different second argument to Sort, but I think the ability to do this directly would be a useful simplification and be more expressive.
|
|
A @= function like the += -= *= counterparts. b@= f would be equivalent to b = f[b] .
Now because Map and Apply and many other functions can be operators you can very nicely apply these to variables:
b = Map[b,f]
b = SortBy[b,Last]
b = TakeSmallestBy[b,Norm,3]
would be:
b @= Map[f]
b @= SortBy[Last]
b @= TakeSmallestBy[Norm,3]
Especially if one could use it with Part, that would be very useful:
b[[All,1]] @= Map[Norm,b[[All,1]]]
would be:
b[[All,1]] @= Map[Norm]
Regarding the name: not sure yet: FixTo ?? (like Prefix and Postfix and Infix )
|
|
Now implemented as //= (ApplyTo).
|
|
TilingData which giving: Symmetries, (translation vectors if they are regular), 'unit cell', 'image', generator with a certain size filling a circle/box (region), 'dual' et cetera...
This is already available in WolframAlpha i think...
|
|
A nice addition to FilledCurve and JoinedCurve would be to support circular arcs of the Circle command.
|
|
I wrote this in 2012. Since then we got all kinds of geometric objects but still no 3D circle.
|
|
How about real-time audio processing? There is pretty aged support for capturing video and manipulating in real-time, but not for audio.
|
|
Another function that would be very useful, but not so trivial to implement (I've tried) is MinkowskiAddition . See the example: Basically it is the addition of two lines or two regions to create a third. In the example it is the addition of the two cat-eye-shaped wedges to create the red shape. This can be very useful in offsetting a path for example.
|
|
Added in 12.3 as RegionDilation
|
|
I would like to see LibraryLink provide functions for simple operations that are commonly needed when creating interfaces to other libraries. In particular, I would like to have a function that transposes data while copying it (to an MTensor). Most libraries store matrices in column-major order (as some distant Fortran-heritage), which differs from Mathematica's row-major preference. This makes frequent transposition necessary when working with these libraries. A naive double-for-loop transpose does not perform well. Something that is written to make use of SIMD instructions (vectorization) and with cache-effects in mind will perform much better. Rolling your own is not at all trivial. I would like to see LibraryLink provide a function like this out of the box. Related
|
|
I'd like to see something like the Matlab code for convex optimization (CVX).
|
|
It would be a nice if modest improvement if XMLTemplate worked with XMLElement or XMLObject arguments as well as string and File arguments. It's not hugely difficult to stick an ExportString in there, but it seems a little weird that we have to do so.
|
|
I would like to have a set of basic functions that make it possible to build my own importers for various text based file formats. Mathematica is quite lacking in this regard as it doesn't even have a fast function to convert the usual floating point format 1.234e5 . There's of course the classic Import , which tends to be quite fast on simple formats like CSV, but sometimes it wants to be too smart and ends up breaking things. There's a need to be able to specify more precisely what format I expect and turn off any automatic guessing. Then there's SemanticImport , which happens to solve the problem I linked to above. We can specify the precise type of each column, which is a step in the right direction, exactly what I want. But it's slow---much slower than Import, and I simply cannot use it for large files, files that are handled fine by import. This is strange because knowing the expected column formats should in principle make things easier and simpler for the importing function ... There's also the thing that while SemanticImport fixed some of the problems of Import, it takes other "problematic" choices even further: it tries to guess even more about what the user wants, it won't let me specify if I want CSV or TSV, etc. In some cases the guesses are bound to be wrong, which is why I also want something that is dumb but follows instructions precisely. SemanticImport is great and convenient but it's too smart for me to trust it blindly ... And finally there's Interpreter, which is really great, and looks just like the thing I'm asking for. Except that it's awfully slow and wasn't really designed for this task (ref) Witness:
str = ExportString[RandomReal[1, {100, 100}], "CSV"];
Map[Interpreter["StructuredNumber"],
StringSplit[#, ","] & /@
StringSplit[str, "\n"], {2}]; // AbsoluteTiming
{8.972, Null}
"SemanticNumber" is probably the fastest non-string type that Interpreter can read, yet it's almost unusably slow for reading even small CSVs.
Compare Internal`StringToDouble :
In[10]:= Map[Internal`StringToDouble,
StringSplit[#, ","] & /@
StringSplit[str, "\n"], {2}]; // AbsoluteTiming
Out[10]= {0.011367, Null}
It's 1000 times faster. But it's undocumented and it has no error checking to detect when the input is not really a number ... I could of course roll my own with LibraryLink, but this really really shouldn't be necessary ... I am currently working with relatively small (smaller than 100x100) CSV files that have both row and column labels. Import messes up things, I have no more trust in it. SemanticImport fails in multiple ways, including failing to read reals when it automatically guesses that something should be integer. It also takes more than a second to read a 90x30 table, which makes me wonder if it would be usable at all for a 500x500 one ... I cannot change the file format because I'm sharing the files with others who use other tools (mostly R). I had to resort to writing my own CSV importer to read the files reliably, but it takes 5 seconds to read just this small file. There simply isn't any way to read these relatively simple labelled matrices in Mathematica quickly, easily and reliably. R can read them with no problem as a proper dataframe but resorting to RLink for something this simply seems very silly! http://mathematica.stackexchange.com/questions/56876/parsing-a-csv-file-using-interpreter
|
|
I also find the import generally slow, especially compared to Matlab. I always convert my data to Real32 or Real64 binary data, those you can read in really fast (direct copy to memory), but it does not feature structured data of course...
|
|
I'm sure you're aware of this, but just for the sake of completeness: There's also still the good old clunky RegisterImport workflow for cases where you need to implement import from a text-based format from scratch. I have no experience with the speed of this approach though.
|
|
Can we have a "fit to page" option for printing? I always seem to end up with twice the number of pages that would be necessary, half of which are empty or carry a single letter. An option not to cut graphics in two, but to automatically insert a page break where necessary would be nice as well. BTW can we have page setting changes (A4 to A3) that actually stick and work?
|
|
I would like better auto-completion for file names:
- Completion relative to the current kernel directory (
Directory[] )
- The ability to add file-name completion for user defined functions.
|
|
Yes, please! I could definitely use that feature.
|
|
Recently lots of fairly basic functions have been added, that seems to serve only as shorthands as they can easily be implemented using already existing functionality. I would like to see functions to zero out the diagonal of a matrix, or to replace it with something else. This sounds like a simple task too, but implementing it in a way that is fast, robust and memory efficient turned out to be not so easy after all. The only good solution that is also simple so far is the one in @ciao's answer on Mathematica.SE. Given that this is not at all obvious, we could really do with a builtin version.
|
|
A way to control the interpolation for function like ListContourPlot: It would be nice if one could give a MaxCellSize -> Somenumber in order to get the following triangulation: Normally the graphic will be completely filled in the ConvexHull of all the point, but this generally created very elongated triangles at the edges...
|
|
Dear All I made a small list of things I would like to see:
Voronoi in 3D
Voronoi not limited to points, also support for lines and regions
Map operator with level specification: Map[f,"Level" -> levelspec]
GeoDistance to accept a list of points (e.g. a trail) giving all the distances for each pair. i.e. a fast implementation of:
GeoDistance[locs_List] := BlockMap[GeoDistance @@ # &, locs, 2, 1]
This is now Implemented as GeoDistanceList since V10.4
MinMax to work on Interval objects like Min and Max does. (Implemented in V10.3)
- Casting of shadows in
Graphics3D
ClippingMask there you can use a polygon to clip some other Graphics object...
GPSForm / GPSString to format GPS coordinates
- General Backtracking algorithm
|
|
Hello,
I want bayesian networks
Now, we have Bayesian statistics and networks
André Dauphiné
|
|
This is not exactly a new function, but a request for more consistency on everything that is related to layout and printing: -> when activating page breaks, everything becomes slow -> there seems to be no way of influencing the page breaks with what's opened, closed or selected -> all screen updates between setting new page format, page breaks, etc are completely out of phase (I set A3, go back again, and it says A4, although ruler is showing A3, or sometimes gets stuck on A4, etc). -> print preview doesn't allows for "selection" option (on Windows) -> the screen zoom actually influences the outcome of the printing, even when everything set to a printout environment, and there are no magnification related configs (Dingbats get misaligned and cut). -> on printout environment, ctrl+mouse wheel reduces magnification, in whichever direction we turn -> Grid forces width but doesn't force height, which feels odd -> less bugs on Grid, Backgrounds, etc. -> well, summing up the two last: some clean-up of the Grid, Pane, Item, etc functions. A lot of options are available, but somehow I get the feeling (which is supported by the amount of post from both communities), that we end up always a small step from being able to do what we really wanted. For instance, although Spacing, Margins, etc, all make sense, in real cases, I always get bitten by an extra pixel here and there, that doesn't get out, or with a magnification dependency, etc. And, if there's a Scaled function, couldn't there be a Imaged and an Itemed equivalent?, or a ItemSizeOverride-> {w,h}, or ImageSizeOverride->{w,h}, for functions that have the opposite type as parameter and not option? -> Something as simple as Grid[{{Item[Rotate["this is a long test example",Pi/2],ItemSize->{3,50}]}},Frame->True] has what I would call an odd behaviour -> and on this one, the rendering is not the same: Grid[{{Style["ABC abc",15,Bold],Rotate[Style["ABC abc",15,Bold],Pi/2]}}] I imagine WR is completely aware of this type of inconsistencies (at least, I see WR employees suffering from them when presenting stuff on live), and so, there's no point on going on (I do send bug reports whenever I find new stuff). But I wanted to present my frustration. Doing most type of analysis in Mathematica is extremely fast. But every single time I need to prepare results into some kind of printable report, I end up crossing, not one, but a few bugs (I really mean bugs, and not simply difference of opinions). Also, thinking that I should just deliver a CDF is unrealistic; to start with, the majority of the companies have the computer admin rights blocked, and installing a new software passes through a process of information risk assessment... and putting it accessible through an online service is a no go in a commercial environment.
|
|
Adding a MaxStepSize option to Plot , so that it would calculate the initial setting for PlotPoints automatically would be convenient. It would effectively set PlotPoints -> 1 + Ceiling[(x2 - x1)/maxstep] or to the default PlotPoints , whichever is greater.
|
|
Circular Hough transform, and possibly the extension to ellipses or even arbitrary shapes. Same implementation as Radon
|
|
Functionality like C++ ostringstreams. Currently it's possible to treat a string as an input stream, but there's no straightforward way to send output to a stream and turn it into a string (you can always right to a temp file and read the file, but that's pretty yucky).
|
|
In Mathematica 9 there is a way to define custom streams, though I haven't used it so I'm not deeply familiar with the API. If you need to write to a string, ExportString works. The problem with repeatedly writing to a string is that stings are immutable in Mathematica, so this paradigm doesn't fit it very well. Of course you can always create a new string by appending to an existing one.
|
|
Better support for functional programming. *Mathematica* is pretty good, but there's definitely room for improvement, especially if you need to, say, build a list in a recursive function. Things that would help include: * Lists built out of cons cells, perhaps constructed using a function named LinkedList or ForwardList, which could be converted to a normal list using Normal. You can do this now, of course, but you either have to use some made-up head for your conses, or be very careful if you're using two-element Lists, and in either case there isn't direct support from functions like `Map`, `Fold`, `Select`, et c. * Functional data structures for sets (and maybe maps). The obvious example would be red-black tree, but there's a universe of options out there. Again, a key advantage would be integration with existing set-oriented functions like `Union` and `Complement`. `Again`, Normal could be used to turn them back into a list The key advantage I'm looking for is the ability to efficiently add or delete elements one at a time, which is really convenient in a lot of circumstances, but is really kind of clunky to do in *Mathematica* as it exists now in a way that's efficient. Also, `$IterationLimit` should default to `Infinity`; currently if you want to use (tail) recursive approaches, you have to wrap everything in a `Block` to keep from stopping prematurely on all but tiny problems.
|
|
It would be great to have option to create Formated Excel files, with control over: 1- Cell color 2- Font Color 3- Column size 4- Border color 5- Export ascreating Excel Tables Object. 6- Cell comments and so on... It would be nice to just create a formated Grid, and when export it using Export["myexcel.xlsx",Grid[myData, A lot of formated options]], that this data could come to excel already formated. I kwno I can use VBScript to do that, but I would like to do all from inside Mathematica, in a more clean/simple way. I automate a lot of reports today using Mathematica, but they are very ugly, due to the lack of format capabilities. I know about ExcelLink, but it's not a direct options to me because it needs Excel instaled, and works just for Windows. I would love to have this improved Export version. If there are another options, please, let me know.
|
|
Along the same lines as better Excel exports, being able to do any exports to PowerPoint would be really helpful. PowerPoint is somewhat terrible, but it's also the lingua franca of many corporate environments. It would be nice if these improvements extended to better export to WMF/EMF formats, which tend to be pretty shaky. Also, while we're improving Grid exports, better support for exporting Grid forms to HTML would be fantastic.
|
|
DeselectWe have Cases[expr,pattern] and DeleteCases[expr,pattern] Why not Deselect[expr,criterion]? (* standard caveat, yes, easy to write your own... *)
|
|
The built-in debugger has a very bad reputation, but in my experience it is quite usable except for one key area: breakpoints. If I don't try to use breakpoints, then it's a very useful tool. Instead of breakpoints it's possible to simply trigger a message or use Assert or similar. (I don't mean that there isn't room for improvement, just pointing out the currently usable solutions.)
|
|
I've been using Mathematica for 12 years or so, and I haven't figured the debugger out yet (for real!). It is just too damn confusing! I would love to see a good video about it, and try to use it ;)
|
|
Because of the scarce documentation, I sent an inquiry about the built in debugger to tech support about a year ago. The response I got was that they recommended I use Workbench, implying the built in debugger was more or less abandoned.
|
|
Maybe it's worth starting a separate thread about that. It would be interesting and useful to figure out a good workflow. I use it occasionally, but not often, and almost never with my own code. But I don't try to use breakpoints any more---bad experiences with those.
|
|
http://www.dbaileyconsultancy.co.uk/debugtrace/debugtrace.html
|
|
About debugger.
I have made this here: community.wolfram.com/groups/-/m/t/250326
|
|
I would like to see the Profiler and the MUnit unit test framework being moved from Workbench into the core Mathematica. Neither of these are inherently tied to the Workbench. In fact I already use MUnit separately from the Workbench sometimes because I prefer to do package development in other plain text editors (such as Vim), and MUnit can be used from within a notebook too.
|
|
@Szabolcs. This would be cool!
|
|
I think we all want break-points, and some simple command to go step-by-step, and hover over any variable and check their current value...
|
|
I would love to see a gui change. I would most appreciate a sidebar, where all functions can be found, and by clicking on them being automatically transfered to that part of my code. It would save me time from scrolling up and down .
|
|
That would indeed be awesome! Furthermore if you right-click on any function it could say 'show definition' either going to the built-in help or your own definition.
|
|
Relational algebra operations would be a good start. Also, the query optimization done by SQL, such as Microsoft's, is very crude. I'm sure the Wolfram Language could do a better job. Given the goal of extending the usage of the Wolfram Language, relational database querying would be a big step in that direction.
|
|
What kind of databases? Relational databases are kind of inherently stuck with SQL-like queries or things you'd find in relational algebra. Are you looking for operations which are composition of relational algebra operations, like some kind of higher order SQL? Or are you looking for functionality for non relational databases like graph databases?
|
|
I'd like to see functionality for querying databases, above and beyond what is provided by SQL.
|
|
Also it would be great if BinLists and BinCountswhere to be extended to: BinIndices(and that it returns in such a way that you can use e.g. extract on it) A lot of times you want to bin your data X, and get the 'associated' data Y. i.e.: {{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-}} Say, you have these data-pairs. then you would like to bin on the first value, and get the second values for each bin. What I do now is to bin in 2D, and have the binsize in the second dimension very very large. But this will only work with numbers, if is it anything else it does not work.
|
|
Or an option for BinLists, that you can specify a pure function as argument (or multiple) and that it bins over each of thse functions-answer. So something like: BinLists[{{x1,y1,z1},{x2,y2,z2},{x3,y3,z3},{x4,y4,z4},{x5,y5,z5},......},{0,100,10},{0,200,10}, BinFunctions ->{First, Part[#,2]&}] I.e. this would bin the data x,y,z ....first over the x values in bins from 0 to 100 in steps of 10, and then over the y values in bins from 0 to 200 in steps of 10. Of course one could specify more difficult functions, let's say Total, or Mean.....With that you make very elaborate binning and would remove the need of BinIndices or so.
|
|
Access to the players kernel, from other interfaces (custom, Excel, etc), to call for functions programmed/prepared with the full Mathematica version. No need to point out the security risks involved... But the need is huge from everyone that is forced to live in the Excel world. Also applicable for any kind of interaction with different local applications (CAD, etc), where server side computation or cloud computation is a no go: too heavy for common simple projects (small teams, etc), too open for confidential cases, too slow for thousands of individual requests (for instance, from Excel calculation update), local work where internet is still rare, etc.. Or where the project dimension doesnt cover for multiple Mathematica licenses. I go even further, and specify the difference between free player and player pro (to protect myself against the "only pro solution"). The free version pops up a pub message at the corner of the screen, every 30 min, while on use, saying Wolfram Research, supporting your computations, the pro version, or the enterprise "produced" version only does it once at the beginning of the session. ;-) PS the community interface still has some interesting bugs. This same post that you are reading was previously substituted by the first entry from Rodrigo
|
|
An option for Interpolate to not extrapolate
Interpolate returns extrapolated values when it arguments are out of the range. However, there are cases where I would prefer that an Interpolation function would automatically clip. Consider this "mistake": data = Table[{x, Sin[x + RandomReal[{-0.1, 0.1}] + x]}, {x, -Pi, Pi, Pi/64}];
intF = Interpolation[data]
Plot[intF[x], {x, -1.5 Pi, 1.5 Pi}]
It would be nice if there were an option to have an InterpolationFunction to either clip its arguments or to return Null. It is fairly simple to find a work-around: clipMyInterpolation[f_, x_] := Module[ {bounds = Flatten@First[f]}, f[Clip[x, bounds]] ]
clipMyInterpolation[intF, 24]
But, it would be nice to have an option such as: intF = Interpolation[data,Extrapolation->ClipBounds] or intF = Interpolation[data,Extrapolation->Null]
|
|
This has been around, but undocumented:
intF = Interpolation[data, "ExtrapolationHandler" -> {Indeterminate &, "WarningMessage" -> False}]
"ExtrapolationHandler" -> function calls function on any input outside the domain. Whether or not to turn warning messages off (as above) can be decided case by case.
This option can be passed to NDSolve as well.
|
|
@Sander I know that it's possible to do it, but it's awfully inconvenient and it takes a lot of manual work. It's much easier to do it using most other plotting packages. There are packages that automate much of this manual work, such as SciDraw, but they have to reimplement a lot of stuf to be able to do this in a general and reliable way (e.g. all of frame and tick drawing) and they still force me to do more manual work, e.g. specify plot ranges manually for every subfigure. (I can't see your figure because Community's image hosting is broken at this moment.)
|
|
There is an add-on program to Matlab called CVX which optimizes convex problems very efficiently. Python has something similar called CVXOPT. It would be good to have an equivalent in Mathematica.
|
|
Generating plots in grids is indeed a hassle: though it can be achieved by using Inset with the right arguments. Making a figure e.g. 10cm wide is a matter of converting it to printer-points, and setting that as a width (for EPS and PDF output). It might appear small in Mathematica, but the output wil be correct. Stay away from Grid and GraphicsGrid would be my advice once you want to make complicated arrays of figures with specified dimensions/paddings. By using inset you make the figures precise, e.g.: This figure was used in a journal where the overall size was important but also the font-sizes were important.
|
|
@Sander nice plot. Can you share your notebook with these alignments using Inset? I normaly use Panel inside Grid. There is some way to share Notebooks in the forum? Let's test it... Update:Do not work using "Add file to this post" buttom.
|
|
Rodrigo, here is the 'template': I minimized the code, hope you can decypher it: z=490; h=z; z1=z/3; z2=2z/3; h1=h/3; h2=2h/3; mleft=40 mright=6 mtop=33 mbottom=35 mtoptop=19 multimargins={{mleft,mright},{mbottom,mtop}}; topfigmargins={{mleft,mright},{mbottom,mtoptop}};
size12={z2/2,h1-(mtop-mtoptop)}; size45={z1,h2/2}; sizeb={z2,h2}; size3={z1,h1-(mtop-mtoptop)}; pb=Plot[Sin[x],{x,0,2\[Pi]},Frame->True,AspectRatio->Full,ImagePadding->multimargins,PlotRange->{{0,2\[Pi]},{-1,1}}]; {p1,p2,p3,p4,p5}=Plot[Cos[# x],{x,0,2\[Pi]},Frame->True,AspectRatio->Full,ImagePadding->multimargins,PlotRange->{{0,2\[Pi]},{-1,1}},Epilog->Text[Style[#,16,Red],{\[Pi],0.5}]]&/@Range[5];
multistrucplot=Graphics[{ (*Red,Line[{{z1,0},{z1,h1+h2}}], Line[{{0,h2},{z1+z2,h2}}], Line[{{0,h2/2},{z1,h2/2}}], Line[{{z1+z2/2,h2},{z1+z2/2,h2+h1}}],*) Inset[pb,{z1,0},ImageScaled[{0,0}],sizeb], Inset[p5,{0,0},ImageScaled[{0,0}],size45], Inset[p4,{0,h2/2},ImageScaled[{0,0}],size45], Inset[p3,{0,h2},ImageScaled[{0,0}],size3], Inset[p2,{z1,h2},ImageScaled[{0,0}],size12], Inset[p1,{z1+z2/2,h2},ImageScaled[{0,0}],size12] }, ImageSize->(size3+sizeb), PlotRange->{{0,z1+z2},{0,h1+h2-(mtop-mtoptop)}} ]; Show[multistrucplot,PlotRangePadding->Scaled[0.01]]
Should give something like:
|
|
Interesting use of Inset. Tks for share it!
|
|
The key thing is to use: - ImageScaled[{0,0}] rather than {0,0}. - Use margins on the 'original' figures, and no sizes) - Specify the sizes in the inset command. - AspectRatio -> Full in the original figures. But I think we all agree that there should be something 'builtin' like image-assemble: graph-assemble. Or that graphics-grid is fixed ;)
|
|
I would like to see graphics handling improved to make it easier to prepare high quality figures. In particular, I would like to have easy solutions to the following problems: - Make it easy to generate a grid of figures which are properly aligned with each other, e.g. like this. Currently this is a huge pain in Mathematica and it's extremely difficult to make the frames line up without a lot of manual work.
- It should be possible, and relatively easy, to prepare figures to size. For example, if a column in the journal is 10 cm wide, I want to prepare the figures precisely to 10 cm, while keeping the font sizes consistent (e.g. 10 pt precisely). This means I can't first make the figure to arbitrary size then rescale it outside of Mathematica because then the fonts will be rescaled too. This is possible currently if I only use Graphics[] objects. As soon as I try to make a Grid[] or GraphicsGrid[], or as soon as I use legends (which do not produce Graphics[], again showing the existing limitations!), it becomes very difficult to do it.
I think all these related problems stem from one thing: ImagePadding (and related measures) are unrepditable and not even knowable by the kernel. They are only known by the front end. For example, if I want to line up frames in a grid, I need to make sure that all frames have the same ImagePadding. However, if I set the ImagePadding manually, I need to make sure that it's not too small that it cuts off labels and it's not unnecessarily large. This involves a lot of manual work and it's difficult to automate because it's not possible to retrieve the automatic ImagePadding without resorting to ugly hacks such as rasterizing the graphic first.
|
|
Access to the guts of ListContourPlot and ListContourPlot3D
It would be very nice to have direct access to the meshes created from contour plots of data as in ListContourPlot. I've extracted the data from the GraphicsComplex that is created by the graphics function, but this seems like a duplication of effort.
Perhaps, such a function could return sets of closed and non-closed surfaces represented by vertex-edge-face data structures.
|
|
@Szabolcs (great... this is now what I want to use... thanks a lot for spoiling...) Very interesting package (that I was not aware of...)! Unfortunately, when putted in perspective with my needs, the price is a "little" out of my league :-(
|
|
@PedroFonseca What you describe is similar to symbolic regression. Symbolic regression means automatically finding a formula that describes the data (by various methods suc as genetic programming, hopefully in a smarter way than brute-force trying a large number of formulae). I'm aware of one commercial Mathematica package for it (see the link). Here are two real world applications of the technique, in case anyone is interested (and to show that it's not as crazy as it sounds): (1)(2)
|
|
I would like to have a (huge) stack of functions available to the model fit functions, so that, with a simple command, one could search on all this stack for the one that best fitted a given data. And then, to be able to sort and filter then accordingly to a fitting criteria, a function family classification, etc.. Functions would be available for at least 2D and 3D data. I know many critics would say that if one is fitting data to a function, it is for certainly because the function has a given known theoretical relation to the phenomenon, which means that there should be no reason for a blind search (I've heard this one too many times...). In my business (and a lot of other ones...), this is not necessarily the case in a lot of situations, and we just need a function that describes a given variation so to integrate the variation in a more complex model. This can be done with the Interpolation function, but as soon as things become a little more complex, there's nothing like a mathematical object that we can see, analyze, etc. This should be relatively easy to start by WR since there's already the Wolfram Functions Site. Also, the functions don't necessarily need to be available on the install, and can be loaded when requested, which means that the framework can start with very little effort, since it can grow along time. I think that there's no need to say that it could also be a very interesting functionality to have available on W|A (just trying to find a budget ;-) )
|
|
NearestGradients as a first cousin to Nearest
I wonder if it is possible to include a "Nearest-like" function that returns points that have the largest magnitudes of gradients respect to a set of fixed data points For example: distanceFunction[v1:{x_, y_, z_}, v2:{x2_, y2_,z2_}]= EuclidianDistance[v1,v2] scalarPotential[v1:{x_, y_, z_}, v2:{x2_, y2_,z2_}] := Exp[-distanceFunction[v1,v2]^2]
data = RandomReal[{0, 1}, {10000, 3}];
nearestGrad = NearestDistanceAndGradient[data, ScalarPotential->scalarPotential[#1,#2]&, InterpolationOrder->2]
and nearestGrad[pt,2] would return a list: { {pt1, distanceFunction[pt,pt1], Grad[scalarPotential[pt,p1]]}, {pt2, distanceFunction[pt,pt2], Grad[scalarPotential[pt,p2]]}, } where pti ={xi,yi,zi} are the points for which Abs[Grad[scalarPotential[pt,pti]] is ordered. I suppose that this would only work for differentiable DistanceFunctions.
|
|
Fast Modifications or Updates to Nearest
I wonder if it is possible to modify nearest with minimal computation if only one or two points are changed. For example, this might be a typical use of Nearest: data = RandomReal[{0, 1}, {10000, 2}]; nearestFunc = Nearest[data -> Automatic] location = nearestFunc[{0.5, 0.5}] EuclideanDistance[{0.5, 0.5}, First[data[[location]]]]
newdata = ReplacePart[data, location -> {0.5, 0.5}];
Now suppose that I only want to change one element of data:Now, I would need to recompute the NearestFunction using all the data. I would guess that it would be faster to update the NearestFunction with information stored in the previous NearestFunction. newNearestFunc = Nearest[newdata] For example, usage of the function might be: newNearestFunction = ReplaceElementNearestFunction[nearestFunc, {i->{x,y,z},j->{x,y,z}}]
|
|
ISO WEEK YEAR NUMBER & WEEK DAY NUMBERIn DateString and DateList, an old request that I still miss in version 10, very common in financial marketing and another business, is ISO Week Number Date related functions (standard in Oracle and SQLServer). - Given a date, what is It ISO Week number and iso week year. Another functions to do the inverse operation would be nice too. For example, Week 04/2014 -> {{2014, 1, 20}, {2014, 1, 26}} A week day number options ((1, 2, 3, 4, 5, 6,7) for (sun mon tue wed thu fri sat)) would be also welcome. Today we have "DayName", "DayNameShort", "DayNameInitial" but not some "DayNumber", very usefull for calculations.
|
|
This has now been implemented:
DateString["ISOWeekDate"]
DateString["ISOWeekDay"]
DateString["Week"]
DateString["WeekShort"]
|
|
Again, this is not about adding new functions but improving existing functionality. I would like to see RLink improved! In particular, I would like to see it (better) support external R installations and support this more seamlessly. It should be possible to set it up to always use a particular external R installation by default (currently this is rather difficult to achieve), external R should be officially supported on all three platforms and it should support the latest R version (R 3.0). Why Would a Mathematica User Care about R?
Quoting from this blog entry, ... with RLink I now have immediate access to the work of the R community through the add-on libraries that they have created to extend R into their field. A great zoo of these free libraries fill out thousands of nichessometimes popular, sometimes obscurebut lots of them. There are over 4,000 right here and more elsewhere. The only problem is that this was not really so at the release of v9, as on OS X and Linux neither external R installations were officially supported, nor package installation (!!). And there's not that much in the base R distribution that I'm interested in as a Mathematica user, all the advantages would come from installing third party packages. The result is that not many people seem to be using RLink despite its huge potential. Later it turned out that there are ways to get it working on OS X and Linux but it's not in the documentation how to do it and it doesn't always work. RLink is an excellent system, it has great potential and clearly a huge amount of work went into it. It is a great pity that it misses that tiny little last step that could make it usable and useful for everyone. I'm really hoping that WRI is not going to abandon it and the necessary improvements (which are really just the few little things I mentioned above!) will be made for the v10 release. Every time I recommend IGraphR to someone, their biggest barrier to using it is getting RLink working on their system with an external package first, then the extra setup needed each time before loading IGraphR.
|
|
Matt, I agree that we need a reliable means of cleanup. I've been wanting this for a while and here's a related thread. There's a helpful undocumented function called Internal`WithLocalSettings, but it's said to be not 100% reliable. I use it sometimes. This undocumented function is an essential element for implementing something like JavaBlock[]. This is also related to my earlier suggestion (above) for a hook into object destruction. There I wrote that the best solution that's currently possible is an analogue of JavaBlock. But JavaBlock also relies on the undocumented WithLocalSettings. So I'd say that this functionality is very important for package developers (even if end users would rarely use it).
|
|
Matt, there's the new StringTemplate in v10, which, unlike StringForm, actually returns a string, and accepts named palceholders.
|
|
@Szabolcs True, for such things it behaves very differently. But I think for most cases people use With, Block and Module almost interchangeably...
|
|
@Matt: Why not use ToString[ , ] incombination with ScientificForm, NumberForm, EngineeringForm, PaddedForm, AccountingForm, BaseForm ? That should solve most cases right?
|
|
@Sander: Yes, you can obviously make it work, but the results tend to be verbose and clunky. One of the things I like about Mathematica's regex functionality is that it supports both traditional regex syntax (which for simple cases is compact and clear) and also a more verbose, but abstract Mathematica DSL that expresses the same thing using familiar Mathematica syntax. I'd love to see the same sort of flexibility in string formating. @Szabolcs: That looks like a step in the right direction, but misses the easy number formatting of printf.
|
|
I also would like a Printf which uses C-style printf strings for formatting and returns actual strings. StringForm returns wrapped objects, which isn't a big deal, but is much more limited than Printf in key respects (there's no real way to control how numbers are displayed). Right now, you have to do something like use J/Link, which is slow and not terribly pleasant.
|
|
I'd like a function that provides reliable clean-up functionality in the face of non-local transfers of control. Something that like finally blocks in Java, or UNWIND-PROTECT in Common Lisp, or like destructors implicitly do in C++. An example would be: With[{stream = OpenWrite[]}, Cleanup[ (* some stuff *),
Close[stream]]];
Whatever (* some stuff *) might be, including if it has Return[], or Throw[], or if someone uses an Abort[] in the middle of it, I want to be sure that Close is run, to the extent possible within Mathematica's semantics.
|
|
What I have wanted for a long time is new functionality for the With command. Using With one can't define a constant in terms of another constant in the same With. I end up with many levels of embedded With commands. I would like to see a generalized form of With like this: With[ {blah1,..}, {blah2,...}, {blah3,...}, expr ] = With[ {blah1,..}, WIth[ {blah2,...}, With[ {blah3,...}, expr ]]] It should be defined for any number of levels. A recursive definition: With[ {blah1__} , {blah2__}, expr__ ] := With[ {blah1}, With[ {blah2}, expr] Clearly, one can avoid such embedding with Block and Module, but it is wasteful to define a variable when a constant will suffice.
|
|
Hi Terrence Honan, meanwhile you can use this implementation by Leonid, that do exactaly what you wants.
|
|
Is there a big performance-gap between Block / Module and With? I never noticed that this is major. Maybe if you have many many small tasks it will make a difference?!
|
|
Sander and Terrence, it's not about performance. With[] and Module[] serve different purposes. Consider With[{a=1}, Hold] and Module[{a=1}, Hold]. With[] is a good way to inject something into a held expression. Suppose you're building a Function object dynamically.
|
|
The Inactivate doc page has a neat implementation of IterateWith that has this functionality.
|
|
Namely, "Replace With by an iterated version, so that later variables can refer to earlier ones:"
SetAttributes[IterateWith, HoldAll]
IterateWith[expr_] := Activate[Inactivate[expr] //.Inactive[With][{first_, rest__}, body_] :>
Inactive[With][{first}, Inactive[With][{rest}, body]]]
With[{a = 3, b = a + 2, c = a + b}, {a, b, c}]
{3, 2 + a, a + b}
IterateWith[With[{a = 3, b = a + 2, c = a + b}, {a, b, c}]]
{3, 5, 8}
|
|
I'd like to see something like UnitStep that returns 0 for 0, while being just as fast as UnitStep and not unpacking arrays. (Right now UnitStep[0] == 1.) Maybe this could be an option to UnitStep. Motivation: Vectorization and always using packed arrays is a good way to speed up computations. I'm talking about this style of programming: (1)(2). When programming like this, it's often necessary to transcribe inequalities in terms of UnitStep. For example, the sum of all numbers greater than or equal to 5 in 'list' can be computed as Total[list UnitStep[list - 5]] This is typically much faster than Total@Select[list, # >= 5 &], depending on the distribution of the numbers in list. While this is a very simple example, generally, the techinique is useful. Unfortunately it is also very cumbersome. Suppose we're looking for the number strictly greater than 5. What then? We will need to use (1 - UnitStep[5-list]) instead, which is still simple, but just too much of a mental effort to think up without making a mistake. This is the problem I'd like to see a solution to, or in general, make it more convenient to vectorize calculations. Of course I do realize that it's trivial to define one's own function for this, or create a package. It would be nice to have it built-in nevertheless.
|
|
Another suggestion is a function to get function information. I have wrote about this in some place in the community that I can't find. Something like, FunctionData[funcionName_], and it could retrive: Mathematica version of implementation, Attributes (that are sometime protected). This should be a simple way to work with version compatibility and select all new implemented functions of some version.
|
|
This now exists:
WolframLanguageData
|
|
- official function to pick up, from an existing/generated Graphic, its different internal components, avoiding things like: Plot[...][[1]] (including a function to illustrate its structure in a kind of graph view of its contents/definition)
|
|
Pedro Fonseca, very nice requests.
|
|
This is of minor importance but being able to plot from 0 to Infinity (via a Tan transformation or something similar) would be occasionally convenient. For instance, given Integrate[f[x], {x, a, Infinity}] copy it and change Integrate to Plot just to get a quick visualization: Plot[f[x], {x, a, Infinity}] It would be more or less equivalent to Plot[f[a + Tan[Pi t/2]], {t, 0, 1}] with Ticks automatically set. Similar it could be extended to plotting from -Infinity to Infinity. There could be issues with determining how fast to approach Infinity (e.g. what value of x corresponds to t = 0.5).
|
|
- be able to name and give order to input fields and other interface objects, so to jump between them in the desired order, or to go directly to a given object - easy way to avoid shift+return or enter to mess up interfaces like input fields (so that I don't need to say " You're pressing it wrong")
|
|
- raytracing (or better/more automatic integration with pov ray or other) - bump mapping - natural management of subscripted variables (already mentioned, but I insist) - drag and drop dynamic objects (to build interfaces like system modeler) - persistent data and "interface" tabular object (meaning excel like object)
|
|
Yes another suggestion, which is not strictly about adding new functins, but about improving existing functionality: Mathematica's philosophy is that the user should be able to input a simple request and be able to get a result automatically, without needing to either care about how that result is obtained or needing to fuss with details. This can indeed be quite useful when getting familiar with a functionality area or doing quick calculations. Many functions, such as NIntegrate, will automatically choose a good method to use internally, and will just work and give a result. However, sometimes the heuristics used for automatic method selection will intevitably fail, and it will be necessary to better understand the available methods and fine tune them. Some functions make this possible, and NIntegrate is a very good example: it even provides a framework for extending it with ne methods. What I would like to suggest is three things: - Make it more transparent what happens when methods are chosen automatically. Make it possible to find out which method was chosen by the system. Make all the values of the relevant suboptions accessible.
- In general, document Method options better! Some functions/functionality, such as numerical integration or unconstrained optimization are quite well documented in "advanced tutorials" (though I wish that subsections of these tutorials were more thoroughly references from the doc pages of the actual funcions). But some other areas of complex functionality, such as graph drawing, are not nearly as well documented. It is typically difficult to find out what are all the available Method options and suboptions for many different functions.
- Provide more fine control! I would like to see more optional fine control, e.g. for graph drawing, accompanied by more advanced documentation. Keep the default on Automatic, but let is fine tune the layout methods better.
|
|
I Agree with Szabolcs. De Graphs are so important in alot of areas that we should have more stabilty there. Don't want to start a me to thread but just want to give a little support.
|
|
Two improvements in help messages. In Dsolve and NDSolve it is not uncommon to see the following misunderstanding DSolve[y'[x]==3*y,y,x] where users seem to usually get the notation correct for derivatives, but then use the function without the [ x ], probably because of textbook notation. If the help system would do a scan for "bare" function names and print out a very explicit help message with exactly the name that needed to be modified and how then this would keep the system from knowing exactly what was wrong, but not explaining it to the user. Similarly, in NDSolve, and other N* functions, it is not uncommon to see the following misunderstanding NDSolve[y'[x]==q*y[x],y,{x,1,2}] where the symbol q has not been assigned a constant numeric value. If the help system would do a scan for symbols which did not have assigned constant numeric values and print out a very explicit help saying exactly what symbol name needed to be assigned a value then this would again keep the system from knowing exactly what was wrong and printing some unrelated message about some non-numeric value at some meaningless numeric value. The system should have all the needed information already evaluated to be able to do a quick scan for both of these just before it wades off into trying to find the real solution. Both these problems are seen again and again.
|
|
One improvement I would really like to see is fixing up the Graph-related functions, especially the property API. It's rather unpredictable and there are lots of serious usability functions, which mostly come up when one would use SetProperty and related functions. I'm not going to hijack this thread by describing examples, but I'm sure people who've used these functions have encountered them ...
|
|
I think that OrderingBy is not necessary. It it were to be analogous to SortBy then OrderingBy[list, f] would give exactly the same output as Ordering[f /@ list], which can even be changed to Ordering[f[list]] for better performance is f[] is one of the optimized listable functions. (Sorry about the code block, the editor mangles what I wrote otherwise.)
|
|
<s>Completely agree with the delaunay triangulation and convex hull; it is VERY slow compared to other packages. Rendering it useless for practical things!</s> huge improvements since version 10. <s>OrderingBy: Like the entire family: Sort/SortBy, Gather/GatherBy, Split/SplitBy</s> not so useful indeed... AxesScaling: An option for ALL the plotting-functions (Plot,ListPlot,ContourPlot, DensityPlot, ParametricPlot et cetera and their 3D variants) that specifies the Axes to be Linear/Log/Date/Custom: AxesScaling -> {"Linear","Log","Log"} would result in a 3D plot with lin-log-log scales. Now you have to do everything manually by renaming ticks and rescaling coordinates (total mess). <s>Please fix the logarithmic ticks: if it spans many orders of magnitude it will do 10^0,10^2, 10^4 et cetera. That is not too bad; the worst is is that it creates 8 subticks between them! They really have no meaning then!</s> fixed since version 10. Local unit recognition; over the internet is just too slow. Just put it as a paclet like many components, so it is updatable.
|
|
@Vitaliy Kaurov You might want to check why the strikethrough < s > tag is not working in the post above... (I added the tags as an edit later).
|
|
Unit were a welcome addition to mathematica, but a pain to use. Please add a "Units Palette" as part of the standard distribution.
|
|
Parallel as an option to some functions? After posting this, I remembered that there are the ParallelTry, Paralellize functions. However, I wonder if some functions might have internal parts that could be paralellized, but for which Parallelize[_] might not work. I don't know if this is true, but I imagine there are cases in which some functions may be parallelized. For example, FindClusters[__, TryParallel->True] or NDSolve`FiniteDifferenceDerivativeADerivative[__,TryParallel->True] would launch kernels if possible and speed up computation. I also wonder if TryGPU might be an option for some functions as well?
|
|
Make Solve and other similar functions "MatrixForm", and perhaps even "*Form" where it makes sense, aware so that people who cannot resist the compulsion to desktop publish their inputs only to then post asking why they then cannot get useful and correct answers out of Solve and other similar functions. If the function gets a *Form input then just strip off the *Form and see if it can the produce a correct answer. This should be a very small programming task. In[1]:= Solve[MatrixForm[{{1, 2}, {3, 4}}].MatrixForm[{x, y}] == MatrixForm[{7, 9}]] Out[1]= {{\!\(\*TagBox[RowBox[{"(", "", GridBox[{{"1", "2"},{"3", "4"}},GridBoxAlignment->{"Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},GridBoxSpacings->{"Columns"->{Offset[0.27999999999999997`], {Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\).\!\(\*TagBox[RowBox[{"(", "", TagBox[GridBox[{{"x"},{"y"}}, GridBoxAlignment->{"Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}],Column], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\) -> \!\(\*TagBox[RowBox[{"(", "", TagBox[GridBox[{{"7"},{"9"}}, GridBoxAlignment->{"Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}],Column], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\)}}
In[2]:= Solve[{{1, 2}, {3, 4}}.{x, y} == {7, 9}]
Out[2]= {{x -> -5, y -> 6}}
There is no need to complicate the task by keeping track of whether *Form has been removed and try to restore that after the calculation, the user can easily add a //*Form to the end of their calculation if they wish. All that is needed is to list every function in Mathematica that would be broken if they are given a *Form and strip that before they begin. This would only try to begin to fill one gap between desktop publishing and the rest of Mathematica.
|
|
Sliders with a logarithmic scale.
|
|
S M Blinder, I saw this attempt at LogSlider. It only produces one-way behavior though (dragging the slider changes the value, but changing the value doesn't move the slider). Here is a simple start for LogSlider that produces the two-way behavior we'd expect. I'll put it as a stub for "Slider (computing)" on Wikicode tomorrow, so it can be collaboratively expanded. LogSlider[Dynamic[x_], max_] := Slider[Dynamic[Log[max, x], (x = max^#) &]]
{LogSlider[Dynamic@x, 10^6], Dynamic@x}
|
|
DataArray and DataStore functions as described by Wolfrm back in 2011-2012 please.
|
|
I'd like a function analagous to Array that creates subscripted variables rather than indexed variables.
|
|
Some very basic integration between CDF Manipulate controls e.g. Buttons and the hosting html page.
|
|
Export of unmeshed BSplineSurface and graphics primitives such as Sphere to a CAD file format such as Rhino's .3dm
|
|
Export of 3D primitives and their boolean combinations to STEP and SAT would be nice. These are universal agnostic formats for transfer between CAD environments.
|
|
A convex hull function that works in dimensions>= 2 and doesn't always triangulate (e.g., the same functionality as qhull)
|
|
Improve the support for keyboard input! CurrentValue should be able to read more than just the modifier keys. The current support for only KeyDown events makes it very hard to make keyboard based controls for games. Sharing games with CDF is one of the best ways to get new people interested in Mathematica. I spent the first several years of teaching myself how to program by making two-player keyboard input games. Friends in my high school classes loved playing them. My school didn't offer any programming classes, and when I started an after school club for programming all people wanted to do was learn how to make games. Mathematica is the only language I've ever used to make a result to show to someone else that doesn't support this functionality. Don't get me wrong. I love that I'll be able to read input from a DIY mass spectrometer in WL, but if you write your code on a keyboard, you need to fully support getting input from it. I don't have any data, but every second of my life tells me that for every student that wants to build a home weather station, we could gain ten users from students sharing games they make with their classmates. Yesterday, I saw one of my friends from internships and the college programming team was making a game with Elm to practice reactive functional programming. I thought, "Hey, I'm making a Spacewar clone in Mathematica right now. I can probably sell him on Dynamic as opposed to Elm's lift and get him to install the CDF player, but I can't make a natural feeling input scheme for the Spacewar clone!" I say this needs to be fixed or Elm or whatever the latest open-source startup language with a non-mainstream idea and a small library will eat Mathematica's lunch. I've got a boat to catch. I'll get caught up in a week. Here's the start of the Spacewar code if you want to try to make turning controls that don't jitter. t0 = AbsoluteTime[]; dt = 0; {width, height} = {600, 400}; stars = {White, PointSize@Tiny, Point@Transpose@{RandomReal[#, #3], RandomReal[#2, #3]}} & @@ {width, height, 30}; ship1 := {White, Line[4 {{{0, -3}, {1, -1}, {1, 1}, {0, 3}, {-1, 1}, {-1, -1}, {0, -3}}, {{1, -1}, {2, -2}, {2, -3}, {1/ 2, -2}}, {{-1, -1}, {-2, -2}, {-2, -3}, {-(1/2), -2}}, If[CurrentValue[ "ShiftKey"], {{1/ 2, -2}, {0, -4}, {-(1/2), -2}}, {}]}]}; {position1, velocity1, angle1} = {2./3 {width, height}, {0, 0}, 0}; EventHandler[ Dynamic[(dt = # - t0; t0 = #) &@AbsoluteTime[]; If[CurrentValue["ShiftKey"], velocity1 += 20 {-Sin@angle1, Cos@angle1} dt]; velocity1 += (10^5 Normalize@#/(Norm@#)^2 dt &)[{width, height}/2 - position1]; Graphics[{stars, {White, Translate[Line[{#, -#}], {width, height}/2] & /@ RandomReal[{-10, 10}, {2, 2}]}, Translate[Rotate[ship1, angle1, {0, 0}], position1 = {Mod[#, width], Mod[#2, height]} & @@ (position1 + velocity1 dt)]}, PlotRange -> {{0, width}, {0, height}}, ImageSize -> {width, height}, Background -> Black]], {"LeftArrowKeyDown" :> (angle1 += 10 dt), "RightArrowKeyDown" :> (angle1 -= 10 dt)}]
|
|
I would like a built-in function which verifies is a degree sequence is graphical, i.e. the same as Combinatorica`GraphicQ without the $RecursionLimit problems that Combinatorica function has. This functionality must already be present in the kernel in some form for use by DegreeGraphDistribution, but it is not publicly accessible.
|
|
This is not a suggestion for a new function, but for some new functionality: a hook into object destruction. It's possible to extend Mathematica using C through MathLink or LibraryLink. Sometimes it's necessary to have some data structure on the C side and make it accessible in Mathematica. In this case it is necessary to have an explicit function for destroying these data structures on the other side, just like in low level languages that don't have automatic memory management or garbage collection. This is somewhat inconvenient. Examples are TetGenDelete (from TetGenLink) and ReleaseJavaObject/ReleaseNETObject (from JLink/NETLink). Java does have garbage collection but the moment Java objects are made accessible from Mathematica it can't work automatically and it becomes necessary to destroy objects explicitly. The best idiom I know for handling this situation is JavaBlock. (One can implement something similar for any library that has its own data structures.) It's much nicer to use than explicit free functions, but it's still not awfully convenient. I wish Mathematica has a hook for expression destruction to make it possible for the free functions to be called automatically. I'm not sure how this would work, or if it's even feasible, but it would be very useful. The fact that even the JLink developers decided on using JavaBlock instead of adding this hook into the kernel makes me suspect that it is not at all a trivial matter.
|
|
DropWhile is easy to implement as Drop[#, LengthWhile[#, ...]]&. Generally I'm against having too many basic functions, as Mathematica already has plenty. But in this case I agree that DropWhile[] would be very nice to have. Since we already have TakeWhile and LengthWhile, DropWhile would be a very natural addition, and I'm sure many people have looked for in the docs just because they new about the other *While functions.
|
|
- DropWhile - StringTake with argument that do not generate an error if the string is too short - StringStartsWithQ some version of Row and Column that have the same syntax and options, or an tutorial explaining why they don't
|
|
Hi Luc, Maybe StringMatchQ["teste", "t*"] can be used in place of StringStartsWithQ ? How would this works?
|
|
StringStartsQ and StringEndsQ are now built-in functions!
|
|
I'd like to see CompilationTarget->"C" with Compile, which means actually CCodeGenerator to be available on ARM or Raspberry-Pi...however. I don't see what complications it involves to support the package on this platform, but there might be a deeper reason why. If someone can enlight me I'd be rather thankful.
|
|
Functions dedicated to elliptic curve cryptography especially curves of the form y^2 = x^3 + a x + b for several pairs {a,b}e.g. Objects Secp[256k1] could be equivalent to EllipticCurve[0,7] and represent the locus of points on y^2 = x^3 + 7 e.g. Char[Secp[256k1]] = 2^256 - 2^32 - 977 Then you could do a lot with tables or plots...without really checking my syntax...here's an example ListPlot[ Flatten[ Table[Table[ Base58[ Char[ EllipticCurve[i, k] , {k,1,10}] {i,-10,40}] ] ]] ] PubKey -> PrivKey complexity order estimations, and other functions e.g. CrackTime[pubkey, curve, speed...] = 10^897 years (ok, safe key...) e.g. ValidKey[pubkey, privkey, Secp[256k1]] = True would verify a keypair emulate parts of keypair exchanges to examing faults e.g. SignMessage[<message>, <type...] e.g. SharedKey[EllipticCurve[0,7], <secret>, <modulus>] Hash pre-image time complexity computations e.g. CrackTime[SHA512, <string>, ...] String Entropy Complexity[<correcthorsebatterystaple>] = ... Rainbow tables Base58 encoding support and in general greater fluency in integer representations So, so, so much could be done. I just rattled this list off the cuff. If there is interest I will put more thought into exactly what would be excellent and write it up formally.
|
|
A very simple addition to ExampleData: icon images. open, close, process, new, add, remove, delete, warning, attention, error, etc
|
|
What I really need almost every day and what is missing in Mathematica for many years is built-in user-friendly ticks generation function. The CustomTicks` package is not sufficiently flexible and easy to use. And why we even have no such functions as LinTicks and LogTicks built-in?! Also we still have no way to control the distance between the ticks and tick labels and between tick labels and frame labels (this distances often are too large by default). All this functionality is crucially important for creation of aesthetically pleasing graphics for publication purposes but up to this time a user must spend a lot of time fighting with extremely user-unfriendly Ticks option and finally anyway cannot achieve the desired appearance.
|
|
I agree with the need for better control of ticks in graphics. But the need goes much further. While our ability to produce good graphics has improved with the recent releases, producing publication quality graphics for scientific journals is still a nightmare. Of course, you can do it, but only by generating an entire page of complicated scripting of graphics primitives. I would like to see Wolfram take this issue seriously. A good start would be to look at available tools such as Igor Pro 6, SigmaPlot, and Origin -- and commit to producing a competetive capability within Mathematica. These tools also provide data analysis capabilities, but Mathematica already excels at this. All it lacks is the ability to make good presentation graphics.
|
|
I agree completely with the prior comment about improving ease of use with Graphics. I know this isn't a single function (as the thread indicates), but I use Mathematica mainly to write interactive demonstrations and documents for my classes, and I find great difficulty in getting graphics to look the way I want without a surprisingly large amount of work, compared with the relative efficiency of much of the rest of the system. Also, on more than one occasion, the program has crashed while I have been adding text boxes to graphics, etc.
|
|
I would like to see a high quality and fast Delaunay triangulation algorithm included as a built-in function. Constrained Delaunay triangulation should be supported. Something akin to TetGenLink, but for 2D, would be very nice. The function from the Computational Geometry package is implemented in Mathematica and is much too slow for many real-world applications.
|
|
A pointer in various, perhaps new, warning messages returned by Solve and relatives to a concise tutorial that explains how to decide what function other than Solve might be more appropriate for the problem that was just given to Solve.
|
|
A pointer in the various error messages returned by DSolve and and similar functions to a tutorial that explains how to provide all the various forms of initial and boundary conditions to obtain satisfactory solutions.
|
|
Novice mode, possibly even on by default, but easily able to be turned off by those who cannot accept having their likely typos pointed out, which would provide help messages to explain, especially to novice users, how Mathematica's expectations differ from their expectations. This would give clear specific help messages, as opposed to the current messages, which would explain what a novice almost certainly needs to change in their input. This would include help for users who have become convinced they must desktop publish their input to Mathematica. Highlight the "offending characters" in red, perhaps even blinking red, to direct attention to exactly where something needs to be changed. While most new users don't seem to write long lines, having the attention focussed on one or a few characters would greatly help. I can recall years ago writing some longer and more complicated expressions and staring at them trying to understand exactly where in that line the message I was supposed to focus my attention. If it could be possible that this be driven by a user readable and possibly even editable, by advanced users, database of rules then this might open up opportunities to experiment with enhancing this. Initially covering really really well the top few dozen most common misunderstandings by new users might help new users scale the learning curve much more rapidly.
|
|
Unify[ notebookfile, notebookfile] which does a Prolog style, but Mathematica aware, unify of two notebooks, showing the minimal changes needed to make the two identical. Diff[ notebookfile, notebookfile] which does a Unix style, but Mathematica aware, diff of two notebooks, showing the minimal differences between two notebooks. Both of these would be very useful in trying to expose the changes that have been made over time to a sequence of notebooks.
|
|
Rodrigo, what are your comments on MapIndexed versus ScanIndexed - any great advantages there?
|
|
You can do the calc just like this: Scan[If[#[[1]] > 0.8, Return[#[[2]]]] &, MapIndexed[{#, #2} &, list]] But for a big list, this is a waste of memory too, to apply MapIndexed to it, just to create a index. You can of couse use a For with Return, but I don't feel it's a nice WL code approach.
|
|
I'd like to see ParameticFindMinimum which would enable running the same optimization problem with different starting points over and over again without setting up the problem each time. There already is ParametricNDSolve, which enables repeated solutions of the same differential equation with different parameters values.
|
|
I would like to see an option DeleteDuplicates for Sort. I have made my own library that implements a function that does the same as DeleteDuplicates, for sorted lists (as it is, it only works for integers). See this. For the case I tested it on it was about twice as fast as DeleteDuplicates. But having the option to delete duplicates while sorting would be even nicer and it would make that library much less "needed".
|
|
Hi Jacob, Union[] will give a sorted list of the unique elements in its argument. Best, David
|
|
David, thank you so much .
|
|
I've been working on a list of potential library extensions that would not go in the System namespace as part of Wikicode. Wikicode to-do listI was going through implementing stub packages for various articles, but I figured I could get a handle more quickly on larger design issues if I just started making a big to-do list. I'm browsing through articles by how close they are to root categories and how popular they are. I'm looking for data visualizations, models, tables, etc that aren't currently in Wolfram Alpha and that could currently be implemented in a page of code or less. Over time, the sophistication of what can be implemented in a page of code will increase and we can build more complex models. The code for each will go in the Wikicode package with the same name as the associated Wikipedia article. Packages can dynamically load other packages. Contexts are typically be based on the article title, but can be nested when necessary to prevent clutter. (e.g. "Economy of the United States" data might go under UnitedStates`Economy if UnitedStates gets too cluttered) I've been asked what an item like "Aluminum: visual attributes as solid" means. For now, it would be convenient just to have named sets of graphics directives for color, transparency, specularity, etc. for common materials. So if I had a model of a soda can I could just put Aluminum`Material[] before it to quickly get something metallic looking. There are plenty of cool opportunities for using parametrized 3D color textures. For example, cutaway views of a simple strawberry model with adjustable size and randomized shape can be supported.
|
|
A class of functions that I would like to suggest is not a new one, but a extension of Scan function. Here are the function: ScanOuter ScanThread ScanInner ScanIndexed
Each one would have the same syntax use of their equivalent (Outer, Thread, ...), but with the same behavior as Scan, with much less memory consumption, due the fact that Scan don't have to "Save" all it results. Other advantage would be to use of Return inside, that opens the possibility to break computation at some moment.As an application example, sometimes I need to apply a function into all combination of to big groups, to take just some specific itens. Let's simulate the lists using a RandomInteger, and Outer to simulate ScanOuter. list1 = RandomInteger[1000, {10000, 2}]; list2 = RandomInteger[1000, {10000, 2}]; Reap[Outer[If[N@Norm@{##} > 1700, Sow[{#1, #2}]] &, list1, list2, 1]][[2]]
I believe that this kind of calculation would use much lass memory with the equivalent Scan function, that do not need to store each result. The calculation above simple don't run in my computer (in less then 5 minutes), and should be almost instantly in ScanOuter. Another nice application is ScanIndexed. Imagine you want to know the position of the element, when it's > 0.8 in this list. list={0.0314503,0.168573,0.291282,0.319608,0.426414,0.430967,0.626601,0.897033,0.923966,0.944242} pos=ScanIndexed[If[# > 0.8, Return[First@#2]] &, list]
To to things like this today, you have to create a index variable, or use a While loop, what makes me very incomfortable inside WL paradigm. ScanIndexed could some this in a more elegant way.
|
|
An important correction is that Streaming` is not a part of official Mathematica functionality, at the moment, but is present in undocumented form. This means that anything there can change in future versions, from function names to semantics etc. Besides, Streaming` doesn't really have the functions mentioned by @Murta, at present - although adding such implementations would be straightforward enough. But even then, they will work somewhat differently, because Streaming` works with data split in chunks, and uses objects which are not usual Lists, although in many ways behave like ones.
|
|
ScanThread and ScanIndexed are here already.
Needs["GeneralUtilities`"]
?ScanThread
?ScanIndexed
|
|
ScanThread and ScanIndexed are here already. > Needs["GeneralUtilities`"]
?ScanThread
?ScanIndexed
But package GeneralUtilities is not listed in Documentation Center page guide/StandardExtraPackages . In fact, a search indicates that this package exists only in the form of a downloaded Paclet.
|
|
Yes, the package GeneralUtilities is not listed in the Documentation Center but nevertheless it is a standard package, not downloadable. I think that this package and the package Internal are only for the developers. There are a lot of interesting things in them.
Needs["GeneralUtilities`"]
?GeneralUtilities`*
?Internal`*
From the package Internal I use the function PartitionRagged time to time. It's strange that there is no a similar function in the kernel. Very useful.
Internal`PartitionRagged[Range[6], {1, 2, 3}]
{{1}, {2, 3}, {4, 5, 6}}
|
|
Reply to this discussion
in reply to
Group Abstract
|