Apgs3arch 0

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
lk050807
Posts: 113
Joined: April 10th, 2023, 4:12 pm
Location: One hour from a river were salmons leap.

Apgs3arch 0

Post by lk050807 » December 17th, 2023, 11:12 am

dvgrn wrote:
September 28th, 2023, 6:24 pm
lk050807 wrote:
September 28th, 2023, 5:57 pm
EvinZL wrote:
September 26th, 2023, 7:50 pm


Do not run Python from the command line or any normal application. It needs to be run from within Golly using File>Run Script
Oh my, now it says:
2023-09-28 18.55.01.png[/img]
I believe that's an error you'll get trying to run Python 2.x code using Python 3.x.

I don't believe anyone has ever ported that ancient most version of apgsearch to Python 3.x, so you'd have to install Python 2.x (or port the code) if you wanted to get that working.
I ported the code in python3, it`s called apgs3arch, to download, run

Code: Select all

git clone https://github.com/lk050807/apg3earch.git
Or see https://github.com/lk050807/apg3earch/b ... /README.md for more.
Last edited by lk050807 on December 18th, 2023, 5:10 pm, edited 1 time in total.
"For the snark is a boojum, you see."
The P3 guy.

Whaz this?

Please support HeartLife

HELP WANTED!
I discovered a new p101 SKOP! Its md5 hash is: b5de045f2a2f5a35160f69afd5ba9572!
Now apgsearching so, not online.

User avatar
dvgrn
Moderator
Posts: 10693
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Apgs3arch 0.0

Post by dvgrn » December 17th, 2023, 12:03 pm

lk050807 wrote:
December 17th, 2023, 11:12 am
I ported the code in python3, it`s called apgs3arch, to download, run

Code: Select all

git clone https://github.com/lk050807/apg3earch.git
Or see https://github.com/lk050807/apg3earch/b ... /README.md for more.
Looks like it's still just one Python script file, so it could be copied and pasted straight off of this page -- once it's in working order.

But ... what does "alpha" mean, exactly? Has this code actually ever been run successfully?

I'm having trouble so far with time.clock() calls, which are deprecated in Python 3.8. I've replaced them with time.process_time() -- not sure yet if I should really be using time.perf_counter() instead, but at least those errors go away.

Unfortunately those errors get replaced with some uglier errors (on my Windows 11 system with Python 3.12 on it):

Code: Select all

Traceback (most recent call last):
  File "wxpython.cpp", line 3, in <module>
  File "C:\Users\Dave\Desktop\B3S23\Scripts\apgs3earch.py", line 2799, in <module>
    apg_main()
  File "C:\Users\Dave\Desktop\B3S23\Scripts\apgs3earch.py", line 2691, in apg_main
    rootstring = ''.join(map(f, list(hashlib.sha256(payoshakey + datetime.datetime.now().isoformat()).digest()[:12])))
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Strings must be encoded before hashing
This is a standard Python2-to-Python3 error, of the kind that still happens after you run a 2to3 code conversion. Does that mean that the code currently in the repo was just run through 2to3, without any actual test execution attempts?

very
Posts: 7
Joined: January 13th, 2022, 9:17 pm

Re: Apgs3arch 0.0

Post by very » December 17th, 2023, 10:20 pm

Here's a version that should work though I haven't tested uploading to Catagolue yet.

It is approximately 60 times slower than the C++ version.

EDIT: The new server is catagolue.hatsya.com, not catagolue.appspot.com.
Attachments
4PGS34RCH (copy 1).py.txt
(92.03 KiB) Downloaded 15 times

User avatar
dvgrn
Moderator
Posts: 10693
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Apgs3arch 0.0

Post by dvgrn » December 17th, 2023, 11:44 pm

very wrote:
December 17th, 2023, 10:20 pm
Here's a version that should work though I haven't tested uploading to Catagolue yet.
The searching and censusing seems to work fine. The script sanitizes inputs such that no matter how low a number you give for soups per haul, you'll get a minimum of 100,000.

It doesn't take very long to reach that number of soups. But at least on my system, I'm seeing a brief flash of the message

"Authenticating with Catagolue via the payosha256 protocol..."

but I don't seem to see that a token is successfully retrieved, and my trial 100000-soup censuses don't seem to be getting uploaded. I haven't tried troubleshooting further than that yet.

User avatar
lk050807
Posts: 113
Joined: April 10th, 2023, 4:12 pm
Location: One hour from a river were salmons leap.

Re: Apgs3arch 0

Post by lk050807 » December 19th, 2023, 5:13 pm

dvgrn wrote:
December 17th, 2023, 12:03 pm
lk050807 wrote:
December 17th, 2023, 11:12 am
I ported the code in python3, it`s called apgs3arch, to download, run

Code: Select all

git clone https://github.com/lk050807/apg3earch.git
Or see https://github.com/lk050807/apg3earch/b ... /README.md for more.
Looks like it's still just one Python script file, so it could be copied and pasted straight off of this page -- once it's in working order.

But ... what does "alpha" mean, exactly? Has this code actually ever been run successfully?

I'm having trouble so far with time.clock() calls, which are deprecated in Python 3.8. I've replaced them with time.process_time() -- not sure yet if I should really be using time.perf_counter() instead, but at least those errors go away.

Unfortunately those errors get replaced with some uglier errors (on my Windows 11 system with Python 3.12 on it):

Code: Select all

Traceback (most recent call last):
  File "wxpython.cpp", line 3, in <module>
  File "C:\Users\Dave\Desktop\B3S23\Scripts\apgs3earch.py", line 2799, in <module>
    apg_main()
  File "C:\Users\Dave\Desktop\B3S23\Scripts\apgs3earch.py", line 2691, in apg_main
    rootstring = ''.join(map(f, list(hashlib.sha256(payoshakey + datetime.datetime.now().isoformat()).digest()[:12])))
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Strings must be encoded before hashing
This is a standard Python2-to-Python3 error, of the kind that still happens after you run a 2to3 code conversion. Does that mean that the code currently in the repo was just run through 2to3, without any actual test execution attempts?
I`m not using 2to3, it is because I`m not a good Python programer.
"For the snark is a boojum, you see."
The P3 guy.

Whaz this?

Please support HeartLife

HELP WANTED!
I discovered a new p101 SKOP! Its md5 hash is: b5de045f2a2f5a35160f69afd5ba9572!
Now apgsearching so, not online.

Post Reply