Skip to content

Fix to deprecation bugs - #1

Open
Jasplet wants to merge 115 commits into
TomSHudson:mainfrom
Jasplet:main
Open

Fix to deprecation bugs#1
Jasplet wants to merge 115 commits into
TomSHudson:mainfrom
Jasplet:main

Conversation

@Jasplet

@Jasplet Jasplet commented Aug 4, 2023

Copy link
Copy Markdown

As we discussed when looking at the code earlier, there are a few deprecation issues. I also plan to put together an updated list of requirements -but this wont happen until monday at least. I have made this pull request now to try and keep this fork in sync before you make any changes. Obviously there are no tests to run, but I can now reproduce the icequake example fully.

Fixed deprecation bugs to allow for compatability with numpy >= 1.20 by replacing 'np.int' with 'np.int64'

Made compatible with pandas >= 2.0 by removing uses of pd.append. this behaviour is heavily discouraged by pandas devs as appending a dataframe does not happen "in place" lsit it does for lists and instead creates a new datafram which is significantly more expensive. This stackoverflow thread gives a nice exapliner https://stackoverflow.com/questions/75956209/dataframe-object-has-no-attribute-append

I have tried where possible to minimise the concateneting of arrays, whilst still preserving the current strcutre of the code.

Jasplet and others added 30 commits August 4, 2023 15:09
…MMENDED FOR DATAFRAMES, replacing with lists which will be turned into a dataframe only when needed as per pandas /stackoverflow reccomendsations
…s'. it is only used to add a column which can be done more effeciently (line wise and computationally) by df['sum_pows'] = sum_pows
… on filt_events_df rather than overwritign it with a view of itself
…, for some reason making a dict first itsn working here?
 under-the hood functins to iprove readability
may want to re-do dir structure at some point too
Longerterm fix would be to write these as hour time series most probably
…streams

this then triggers self.n_win to evalute to -20 which raises a
negative dimension error.
this is occuring because Stream objects are being trimmed incorrectly at the END of a query
testing for starttime >= query and endtime <= query patches this
more testign needed to ensure this is working as intended
Added comment on why this fork exists
Using starttime_this_st results in the INCORRECT times being in some cases
If the loaded data is trimmed so that it does not start on the hour.
Then starttime_this_st is not at the hour either.
This breaks for queries longer than 1 minute.
My fix is instead to assign time from the minute trimmed chunks of data.
For queries longer than a minute this means the minute bemform time series are given the correct times.
For queries < 60 s the trimmed data starts at query start, so times should be correctly
assigned from that reference point.
moved run_array_proc to appear before
this reduces the number of nested for loops
which can only be a good thing :-)
finished jday -> mmdd retool
and fix bug in printing of times, i wasnt adding the right hour!
streams where starttime == endtime were possible, and now shouldn't be.

also moved deletion of power spectra and garbage collection
to be within the minute for loop as there doesn't appear to be a reason why we wouldnt do this
Jasplet and others added 30 commits June 4, 2024 16:54
reomvoe for loops in _phase_associatior for gettign t in seconds after start
…by bazi differnece and phase seperation (close P and S preferred)
Revert as adding extra power/bazi columns is not super useful and adds confusion to reading outputs

This reverts commit 2a4b257.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants