Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no attribute 'identify_all_trends' (most likely due to a circular import) #13

Open
maciekinlondon opened this issue Nov 5, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@maciekinlondon
Copy link

maciekinlondon commented Nov 5, 2020

Hi,
I've tried to run trendet script but it gives me an attribute error:
AttributeError: partially initialized module 'trendet' has no attribute 'identify_all_trends' (most likely due to a circular import)
Do you have any idea what that could be?

@bagcivan
Copy link

I'm getting similar error

AttributeError: partially initialized module 'trendet' has no attribute 'identify_df_trends' (most likely due to a circular import)

@alvarobartt alvarobartt self-assigned this Apr 20, 2021
@alvarobartt alvarobartt added the bug Something isn't working label Apr 20, 2021
@alvarobartt
Copy link
Owner

Hi both @maciekinlondon and @bagcivan, thanks for reporting it! I'll try to solve this later today hopefully and then release a new version with the updated code! 🔥

@trev1966
Copy link

trev1966 commented Oct 4, 2021

Hi alvarobartt, Im getting the same error. Strangly when I first installed the library it worked fine, without changing anything I returned to the code last night 3/10/2021 and it gave this error. Ive tried updating the library without success.

I was running the sample code listed below

Any news on a fix ?
Thanks

import trendet

import matplotlib.pyplot as plt
import seaborn as sns

sns.set(style='darkgrid')

df = trendet.identify_all_trends(stock='BBVA',
country='Spain',
from_date='01/01/2018',
to_date='01/01/2019',
window_size=5)

df.reset_index(inplace=True)

with plt.style.context('paper'):
plt.figure(figsize=(20, 10))

ax = sns.lineplot(x=df['Date'], y=df['Close'])

labels = df['Up Trend'].dropna().unique().tolist()

for label in labels:
    sns.lineplot(x=df[df['Up Trend'] == label]['Date'],
                 y=df[df['Up Trend'] == label]['Close'],
                 color='green')

    ax.axvspan(df[df['Up Trend'] == label]['Date'].iloc[0],
               df[df['Up Trend'] == label]['Date'].iloc[-1],
               alpha=0.2,
               color='green')

labels = df['Down Trend'].dropna().unique().tolist()

for label in labels:
    sns.lineplot(x=df[df['Down Trend'] == label]['Date'],
                 y=df[df['Down Trend'] == label]['Close'],
                 color='red')

    ax.axvspan(df[df['Down Trend'] == label]['Date'].iloc[0],
               df[df['Down Trend'] == label]['Date'].iloc[-1],
               alpha=0.2,
               color='red')

plt.show()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants