Support for extension dropped; new onboard function replaces extension functionality

I have been using a Calc extension, XPysort, for several years in support of a user. Support for the extension has evidently been dropped, but a new onboard sort function effectively replaces it.

My problem is I have about 5 years of historical spreadsheets my user occasionally needs to access. If she tries to use the new version of Calc, these historical files won’t open correctly. She can use an older version, but then that older version cannot be used to build new sheets because the extension is not supported.

As we go forward, I can either try to maintain two versions of LO Calc for her and instruct her to use the correct one depending on the age of the file she wants to open, or I can go back in history and rewrite the files to use the new onboard function. Either of these approaches seems clunky, so I was wondering if the experts here had any advice for me.

Background of my experience can be found here.

Thanks very much for any advice

In such situation, my recommendation is to try minimizing the workload.
Your solution to maintain two versions looks fine, if, most of the time, the old documents are used for reference only, not for update.
If, from time to time, an old document needs update, then I would recommend to update it in a way that it doesn’t require XPysort anymore.
I would use a clear naming convention by appending _old to the names of the old documents may help in the process.

1 Like

If the extension issue cannot be resolved readily, you could parallel install an older version of LibreOffice just to work with the old extension while keeping a more modern version for other work. Installing several versions of LibreOffice in parallel - The Document Foundation Wiki

1 Like

trying to sort out what the actual problem is, have to go down convoluted posts / bug report / zip / ods … :face_with_thermometer:
would be wise to narrow this down with the simplest possible example.
would make sense to add “python” as tag of this topic :wink:

would then first quantify it :wink:

which is how many files ?
calls to the failing python code ?
to be replaced by what ?

LO Calc evidently no longer supports the XPysort extension, which I’ve used for the past 5 years or so in support of my user. The XPysort functionality has been effectively replaced by a new “Sort” function in Calc, so as I continue to build spreadsheets for my user, I can use this new sort function instead of the old XPysort. The problem I’m reporting is if I convert my user to one of the latest versions of LO Office, she won’t be able to open any of her old spreadsheets. @EarnestAl and @Steph1 have provided a couple options for me to look in to.

Whatever I do needs to be transparent to my user, as she is not computer-savvy. For example, if I opt for a two-version solution, then it would be great if Windows opened the “correct” version on double-clicking a file based on it’s age or something similar, for example. (She also uses LO Calc for other things unaffected by the XPysort issue.) But, I digress.

I believe the problem I reported two years ago and for which a bug report was written, is well-documented here. I’ve included that link here only for background, in case someone wants to look into the original problem. You apparently are interested, and I appreciate that. I did update that original post (and the bug report) recently, but I’ve gotten no feedback on those updates. Frankly, it’s been two years since I reported that problem, and I’ve given up on a “fix” for it, especially since new onboard functionality replaces it. So, in particular, python is not part of the problem I’m reporting here. That leaves me with the “multiple versions” problem I’m seeking advice on here.

I build one spreadsheet per month for my user, and there are 9 months in her fiscal year. So, over a 5 year period, there are 45 files to be re-written. Re-writing them would involve changing one line in each spreadsheet that replaces the call to XPysort with a call to the new Sort function. It would probably require a few hours work on my part.

There should be no problem using old extensions with newer versions - we almost never make compatibility-breaking changes (at least purposefully). Do not assume that some support was dropped; instead, just file a bug report. A new functionality that duplicates the extension is not a reason to drop any support.

EDIT: I have tested the extension using Version: 25.2.3.1 (X86_64) / LibreOffice Community
Build ID: d8d1af5f77df955194e52baabe19324532ac8e8b
CPU threads: 24; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (en_US); UI: en-GB
Calc: CL threaded

and it works just fine (I used an array formula like {=PYSORT(A1:A10)}, on a random integers in A1:A10 - and the result is the correctly sorted data).

Thanks for your feedback and support. I’ll try to use the XPysort function again and report back. If it does, then this problem goes away.

Please note that I assumed support was dropped because I got no response to my re-test of the bug report.

Please don’t assume any responsibility of anyone to provide timely replies (especially in the bug tracker). Additionally, bug tracker is not any kind of help desk - it’s a tool for developers, meaning, that bugs are created and improved by interested parties with sole purpose of making it possible for a developer to take it and work on it to fix / implement. Thus, there is no requirement to answer any comments there - the comments will add more relevant info, and that info could be useful to a developer when they happen to get interested in that bug.

(Just to establish correct expectations, and avoid confusion like that.)

I understand your point about responsibility. As a user, I only know what I see here and in the bug report. I saw nothing in either place even though I did respond to the request to re-test. So, seeing no response and being unable to get the extension working, I assumed support for the extension was dropped and moved on to try to figure out how to handle that.

Another solution I neglected to mention above is to keep my user on version 7.2.7.2, which supports Xpysort and filtering on the results.

Note that I have managed to install XPysort on the following version of LibreOffice:

Version: 25.2.2.2 (X86_64) / LibreOffice Community
Build ID: 7370d4be9e3cf6031a51beef54ff3bda878e3fac
CPU threads: 12; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

The extension installs and sorts data correctly, but I can’t filter on the results. That filtering problem is not present in version 7.2.7.2. The filtering problem is the bug we reported about two years ago. It’s still present.

I’m afraid I’m confusing this thread with multiple issues now, so I will try to clarify where I stand: I can’t use XPysort with newer versions of LO Calc because I can’t filter on the sorted results. I can filter on sorted results if I use the new onboard Sort function, and I can filter on sorted results if I continue to use version 7.2.7.2 and XPysort.

So, I have these alternatives:

  • Continue to use LO 7.2.7.2 for the foreseeable future
  • If a fix is implemented for the filtering problem, upgrade to the latest version of LO and use either XPysort or the new onboard Sort function, since both will work
  • Adopt a multiple version solution using latest versions of LO plus the onboard sort function for newest files and 7.2.7.2 for old files

I guess unless there are compelling reasons to upgrade to the latest version, the first option involves the least work.

I look forward to any feedback, and appreciate your patience with me.

the more reasonable sounds to have a macro for that :

and even not sure how 45 one-liners could amount to “a few hours” :wink:

If you’re saying I should write a macro that opens a file, changes a line from XPysort() to Sort(), saves the file, closes the file, then repeats for all 45 files in 5 different directories (one for each year), then I’m looking at many hours of development time to develop a macro that I’ll only use once. I’ve never had much luck developing any but the simplest macros in LO.

You’re obviously a much better and faster programmer than I am. If I estimate 10 minutes per file to open it, make the change, verify the result, and save it, then that’s 450 minutes, or just under 8 hours. Not a lot of time, granted, but enough to at least look for a quicker way.

Incidentally, each of the 45 files I would need to change contain about 25 separate sheets, with the same logical sheet occupying a different position in the list of sheets as I fixed bugs and added functionality over the years.

45 or 45*25 doesn’t make much of difference if automatized.

but is the problem (now) (still) (just) to replace (any) PYSORT(x) with SORT(x) ? wherever they are ?
you may get help if the specs are clear.

or will you keep on “well-documenting” / digressing ? :wink:

Well, I guess you’re saying that the way to handle this is to write a macro to automate the process of changing XPysort() to Sort() everywhere. That’s well beyond my capabilities and, although I appreciate your apparent offer of help in writing this macro, I suspect it would take longer to write the macro than it would to simply change lines in 45 sheets to reflect a change from XPysort to Sort.

Because you’ve pressed this point, and not because I wish to digress, I will mention that the (multiple) arguments to these functions contain cell references that can change from month to month as I add functionality and fix bugs of my own making. So, for example, the value I need from, say, sheet1.a1 in month m might end up in sheet1.b1 in month m+1. The spreadsheets have, unfortunately, not been designed to make such changes easily automated.

Don’t get me wrong: I appreciate your persistence in trying to drive me to a good solution. Thank you.

I think, on reflection, the best answer for me is to keep my user on version 7.2.7.2 as long as possible or until a “fix” to the filtering problem with XPysort is developed. I have several computers myself and I’ll make sure at least one of them is also running this version.

how does that relate to    replace (any) PYSORT(x) with SORT(x) ? :thinking:

I just went through an exercise to convert one (of 45) spreadsheets to use SORT instead of PYSORT. It took me about an hour. PYSORT and SORT have different calling parameters, so you’re replacing PYSORT(x) with SORT(y). PYSORT admits a range that could include a header row, SORT does not. I included the header row in my call to PYSORT. I have to remove that from the range passed to SORT. That means I have to copy the header row as a separate operation and paste it into the result sheet, then associate the SORT formula with cell a2 in the result sheet instead of a1.

Both PYSORT and SORT are array functions which means, among other things, that certain cryptic operations are required to replace a call to PYSORT with one to SORT. For example, you can’t associate the SORT formula with cell a2 until you delete all data from the result sheet and copy the header row into the result sheet from the source sheet. Deleting data from the result sheet also requires a special device to highlight the data in a way that allows it to be deleted.

I’m rather enjoying our tour of the Socratic method, if that’s your intention. I think I could reduce the amount of time it takes to convert one file to about 10 minutes, and I might do that, depending on the needs of my user. I think it would be extremely difficult to write a macro in LO Calc to do this. You could probably write a C or BASIC or Python program to do so and interface it with LO; i.e., create an extension, but that seems like a lot of work for an extension that would only be used once. It’s well beyond my capability, in any event.

Thanks for sticking with me!

somehow typical XY problem - Wikipedia :neutral_face:

always ?

:thinking:
ctrl+ / ?

It appears as if no one else is following our discussion, which has now apparently progressed into the metaphysical, so I’ll reply to you personally.

If you’re saying, after reading everything in this thread and the previous one on filtering, that you don’t understand the problem I’m trying to solve, or perhaps that you don’t think I understand the problem I’m trying to solve, then there is no point in continuing our discussion. If you do understand and have a suggestion on how I should proceed (as others have), then I’d very much like to hear it.

As you ponder your response, consider the following:

  • About two years ago, I identified a bug in LO Calc that was preventing me from filtering the results of the XPysort function. It was introduced after version 7.2.7.2 and has remained since. As far as I know, no one has tried to “fix” it
  • I need to filter sorted data for my user, so kept her and myself on 7.2.7.2
  • I’d like to explore upgrading to the latest version of LO, just because it seems like a good idea
  • If I upgrade and the filtering bug is not fixed, then I need a two-version solution, I need to re-write old files to be compatible with the new SORT function, or pursue some other solution.
  • If the filtering bug is fixed, I can upgrade and leave historical files alone and either continue to use XPysort or change over to SORT for new development

Because I did not get a response on the bugfix after two years and could not even install XPysort on a recent version of LO Calc, I reasoned that a fix was not forthcoming and that support for XPysort was dropped, so I created this thread seeking the advice of the collective on how to proceed.

Since @mikekaganski has stepped back into the discussion, I might get some further information on the likelihood of a fix to the bug. The people tracking the bug are not interested in my feedback, and indeed have declared that my most recent update was irrelevant to them.

You now have a complete accounting of where I’ve been. If you have an idea or suggestion about how I should proceed please advise. Otherwise, I completely understand, thank you for engaging me, and I’ll bid you adieu.

XY problem has nothing metaphysical – when you have time, go (re)read the wiki page, or other flavours of the matter : What is the XY problem? - Meta Stack Exchange

Nothing wrong there, we know it happens. FYI just now : Macro to copy formulas only in Calc does work only sometimes - #13 by cogito1


So, for the last time (I swear) : if you want to expect help/support, answer the above questions precisely/accurately; i.e. not with paragraphS of hypotheticals, but with figures and examples.

I think it’s time for me to say goodbye. I have gotten useful information in this thread and thank those who contributed. I understand my options given the problem I’m trying to solve. I’ll choose an option and proceed.

You and I have descended into a philosophical, if not metaphysical, discussion, wherein you’re evidently suggesting that I’m not providing a clear, concise definition of the problem I’m experiencing while I believe I’ve described the problem as precisely and clearly as I can. You seem to think I’m seeking help in writing a macro to modify a spreadsheet. I’m not. As you contemplate further my “XY Problem”, I suggest you re-read my last post to try to understand the problem I’m trying to solve. Perhaps it’s you who has the XY Problem?

Regardless, I’m finished here. I bid you good day!