Git Product home page Git Product logo

Comments (17)

Shadowen avatar Shadowen commented on June 8, 2024 1

Hey, I'm going to fix up your existing tests! No guarantees on any new tests being written though...

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

You might want to hold off fixing any tests of timelapse.py, btw. It's going to change a lot soon when I remove the pause/resume from the snapshot process.

from octolapse.

Shadowen avatar Shadowen commented on June 8, 2024

Can you please post the contents of c://test? I'm on a Ubuntu machine and this is completely breaking most of your tests anyways. I'll see if I can trick it with some temp directory magic.

Brb, reading up on how settings are stored to begin with.

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

It's just a log path. We can change it to a a subdirectory of test and add to gitignore?

from octolapse.

Shadowen avatar Shadowen commented on June 8, 2024

I need an Octolapse profile. A lot of the tests are erroring out because the printer homes, but all positions still return None.

In position.py, the plugin detects G28 Home and does:

pos.X = self.Origin["X"] if not self.Printer.auto_detect_position else None

self.Printer.auto_detect_position = True (I think this is correct, as default). So it sets pos.X to None. And no homed position/coordinates is ever generated. Am I missing something?


By the way, it takes like 2 lines of code to use a temp directory and it works out fine. SHOULD be fine.

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

from octolapse.

Shadowen avatar Shadowen commented on June 8, 2024

I suppose I should give a clearer example:

In test_trigger_gcode.py

		# home the axis and resend the snap command - will be false because the PREVEIOUS state must be homed
		position.Update("G28")
		trigger.Update(position, "snap")
		self.assertFalse(trigger.IsTriggered(0))
		self.assertFalse(trigger.IsWaiting(0))

The first trigger.Update(...) parses the home command, so following commands should be homed.

The test continues with:

		# try again, should now work
		position.Update("Snap")
		trigger.Update(position, "snap")
		self.assertTrue(trigger.IsTriggered(0))
		self.assertFalse(trigger.IsWaiting(0))

Somewhere in the trigger.Update(...), we have the following if-else:

			if(not position.HasHomedPosition(1)):
					... (skip command)
			else:
					... (parse command)

However, it appears if(not position.HasHomedPosition(1)) is True (branch is taken), so it never even attempts to parse the command. Is this working as intended?

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

I have fixed most of the tests that were throwing exceptions. Most of this (and probably most of the other breaking changes) was due to the addition of the circular buffers you noticed. These were added to position.py and extruder.py so that I could easily 'Undo' position and extruder updates. I figure they might be useful in the future to allow for more complicated triggers/snapshot gcode. I hadn't planned initially on doing this, but realized at some point that it was necessary. You can imagine how much that change affected everything.

Since you mentioned working more on the tests, I'll push these changes as soon as I run a couple quick test prints.

from octolapse.

Shadowen avatar Shadowen commented on June 8, 2024

Would be great! I'm mostly looking at position.py. By the way, the structure I'm looking at using is collections.deque.

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

Ok, Just this AM i standardized most of the calls to Position that retrieve something from the PositionState (GetPosition), and I did something similar to extruder.py (GetState). I didn't change it everywhere, but hopefully that will make what you're doing easier.

BTW, I'm having some trouble with Git recognizing my credentials. This has happened before and it's something to do with the credential manager. I'll let you know when I've pushed the changes I've been making this AM.

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

K, those changes are in BetaDevelopment now after applying a patch to my IDE (apparently there was an issue with TLSv1.2).

I'm really sorry if I stepped on your toes with this update, but I didn't expect us to both be working in the same file (position.py) this morning!

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

I'm super confused. I pushed those changes but I don't see the commit on github.com. However, when I clone betadevelopment, the changes are there!

Can you let me know if you see this line in utility.py after pulling the latest code from BetaDevelopment branch?

Line 281: return None if v is None else min(max(v, v_min), v_max)

If it's there I"ll assume it's some glitch on github, otherwise I messed something up somehow.

from octolapse.

Shadowen avatar Shadowen commented on June 8, 2024

Looks fine on my end.

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

Aside from test_timelapse.py (which will be a real bear), there are 7 tests left to fix in the following files:

test_utility.py - 2 fail
test_timerTrigger.py - 4 fail
test_layerTrigger.py - 1 fail (I thought I fixed this one...)

Getting close!

from octolapse.

FormerLurker avatar FormerLurker commented on June 8, 2024

All of the tests except those from test_timelapse.py are fixed! There are probably some flawed tests in there, but we'll find them eventually. At some point many probably need to be re-written, split or removed. I'm going to create a separate issue for test_timelapse.py, since it will probably need to be completely rewritten anyway, but probably won't do this until timelapse.py is re-written to include Gina's newly implemented lock that will allow me to take snapshots without pausing the print. I fear we will need a testing master to write useful tests for timelapse.py, though....

FYI, I changed trigger.py so that it looks at the current trigger state instead of the previous to determine when to trigger. Then in timelapse.py I look at the PREVIOUS trigger state. This REALLY simplified a lot of the tests by preventing me from having to send a dummy command (or other such nonsense) to read the previous trigger state. Honestly I have no idea why I did it that way in the first place, but it's fixed now!

I deem this issue CLOSED! Thank you so much for your help. I was DREADING fixing these up, but knew it would be good medicine.

from octolapse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.