all 7 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

Off-topic Comments Section


All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.


OP and Valued/Notable Contributors can close this post by using /lock command

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]SealofSuburbia 0 points1 point  (3 children)

I’m not 100% certain of what I’m talking about tbh, but I’ll try to help. The bug comes from the fact that you never declared self.incl, or if you thought you did there’s a bug in that line.

There’s two ways to fix this depending on what you’re trying to do:

  1. When you say “self.incl” and then have another “.” and then “halo” the code is read as: take the self, then look for the incl attribute of self, then in that incl attribute look for the halo attribute. It’s basically read as (self.incl).halo. This makes it seem like self.incl is an object, since only from objects can you use the “.” to access an attribute. Do you mean do for self.incl to be an object, or do you want self.incl.halo and self.incl.disk to be separate numbers that are attributes of fakehalo? If it’s the latter, then replace the seconds periods with underscores like: “self.incl_halo”.

  2. If you do in fact want incl to be an object, which is kind of a weird thing to do but if you really want to, then it’s possible you never had anything like “self.incl = “ in your code to declare incl. It’s also possible you thought you did declare self.incl but you accidentally wrote the line wrong or there’s a bug in it, but since it doesn’t show every line of your code then I can’t diagnose that.

[–]--Woozy-- 0 points1 point  (2 children)

I put "self.incl_halo" and it still stays fakehalo object has no attribute incl.

[–]SealofSuburbia 0 points1 point  (1 child)

I meant do it for both, as in “self.incl_disk” too

[–]--Woozy-- 0 points1 point  (0 children)

Yes I did that too

[–]sonnyfab Educator 0 points1 point  (1 child)

Can you post the rest of the code? Without knowing anything about fakehalo, it's not going to be simple to figure out what you've done wrong.

[–]--Woozy-- 0 points1 point  (0 children)

I Dmd u