2117 poll for new heads doc updates

Updated documentation.  Includes design and configuration updates.
Related issue(s): #2117

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.15%.  Consider uploading reports for the commit 373df90 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2159   +/-   ##
=======================================
  Coverage   75.15%   75.15%
=======================================
  Files          13       13
  Lines         644      644
  Branches      118      118
=======================================
  Hits          484      484
  Misses        115      115
  Partials       45       45

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


ICESat-2 ML tutorial - photon classification on ATL07 sea ice data

Draft tutorial for doing ICESat-2 ATL07 photon classification into 3 surface types (open water, thin ice, thick/snow-covered ice). Deciding to do a reimplementation of @YoungHyunKoo's code at https://github.com/YoungHyunKoo/IS2_ML.
Preview at https://deploy-preview-17--icesat2-website2024.netlify.app/tutorials/machine-learning/photon_classifier

Excalidraw file: ATL07_photon_classifier.excalidraw.tar.gz
TODO:

[x] Initial layout with learning objectives and sections
[x] Pre-processing code to read ATL07 sea ice data (6 data variables) from HDF5 to a geopandas.GeoDataFrame
[x] Find coincident Sentinel-2 image to extract surface reflectance values
[x] Show how to move data from disk/CPU to GPU
[x] Architect the Machine Learning model
[ ] Show training results

Xref: https://github.com/uwhackweek/schedule-2024/issues/38
References:

Koo, Y., Xie, H., Kurtz, N. T., Ackley, S. F., & Wang, W. (2023). Sea ice surface type classification of ICESat-2 ATL07 data by using data-driven machine learning model: Ross Sea, Antarctic as an example. Remote Sensing of Environment, 296, 113726. https://doi.org/10.1016/j.rse.2023.113726

This should be ready for an initial round of reviews. If possible, I'd appreciate some help with the authentication issue at https://github.com/ICESAT-2HackWeek/website-2024/pull/17#discussion_r1708524246 (need to grab both an ATL07 file and also Sentinel-2), but I can also try to sort that out over the weekend.
There are a few other things I'd like to add to the notebook such as more explanation text at the start, and also show what the trained model's predicted ATL07 photon classifications look like, but that can be done in a follow-up PR.

Thanks Scott, I've added an overview diagram at the top, and have pushed the pre-rendered notebook (6.0MB) :see_no_evil:. Will merge this in now, and might work on some extra stuff at the last section (e.g. show the model training results section a bit better) in a follow-up PR if there's time.

I know this PR is closed, but is this a photon classifier or a segment classifier? Photon classifiers label the individual photon events from ATL03 (e.g. YAPC or the land/veg classifier).

I know this PR is closed, but is this a photon classifier or a segment classifier? Photon classifiers label the individual photon events from ATL03 (e.g. YAPC or the land/veg classifier).

Ah yes, I should probably have called this a point cloud classifier since ATL07 is based on a aggregate of ATL03 points. Let me fix that in a follow-up PR later.


Camera not initialized message

Thank you for creating such a great package. I gave it a thumbs up.
One issue is that the camera not initialized message displays even if the text in the uninitialized container is changed to something else.

The problem has been fixed and a new version has been released. Please update to the latest version

Perfect, thank you for fixing this.


uv add should support adding dependencies without updating the environment

e.g. uv add --no-sync
The same for uv remove.

--frozen does this, unless you're describing something else.

I want to update the lockfile, but not install into the virtual environment.

Why?

What if I don't have a virtual environment and I'm just trying to modify the declared dependencies in an automated script? Why have all the overhead of installing the project to a virtual environment?

(This came up when writing documentation — we could wait until someone asks for it before adding but I do think it makes sense)

It's reasonable! Just wary of adding too many flags here.


How to parse into D3 Date_Time format with forward slashes

Channel_Name,  Date_Time, Offset, Value, Code
9334638004/01,01/08/2015 01:30,1,11.223,0

Please use Stack Overflow tag d3.js to ask for help. Although I make an effort to assist everyone that asks, I am not always available to provide help promptly or directly. Stack Overflow provides a better collaborative forum for self-help: tens of thousands of D3-related questions have already been asked there, and some answered questions may be relevant to you.
When asking for help, please include a link to a live example that demonstrates the issue, preferably on bl.ocks.org. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response.
If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.
Thank you! 🤗

Also, to answer your question, you just put the forward slashes in the expected place in the format specifier:
var parseTime = d3.timeParse("%m/%d/%Y %H:%M");
parseTime("01/08/2015 01:30"); // Thu Jan 08 2015 01:30:00 GMT-0800 (PST)

https://runkit.com/57d8702e1ff21014007f12d5/57e00ba2e62a1c1400b2cc62


<EMAIL_ADDRESS>

I'm very happy

@Asymvivastos
Thank you for your post!
Since this is a duplicate of https://github.com/MicrosoftDocs/azure-docs/issues/70752, I'll go ahead and close this out.


Prevent rules with :selection from being merged

Firefox does not support :selection, only :-moz-selection. This change adds :selection to the list of problematic selectors to prevent invalid rules from being created.
Also cleaned up the regex, : and :: are equivalent in this regex, so reduced all section to just :.

Encountered the issue with this file where rules in line 20 and 40 were merged and created a invalid rule in turn.

Good catch @silverwind, thank you!

And released as 3.4.20. Cheers!

Thanks for the quick turnaround, as always!


Extra parameters to render

Hi,
I first wanted to thank you for the great work here. I just discovered this gem a couple of days ago and I got amazed as it seems exactly what I needed.
Or almost... I just came to one problem: I have to render the response according to some parameters in the request. In a specific case, I have a model with a description attribute that can be rendered in multiple languages, so I need to find a way of passing the params[:locale] to the renderer.
I haven't found a way to do this or maybe I'm not seeing clearly. Can you please point me in the right direction?
Thanks!

Hey,
Thanks for your response :). No, I'm not using I18n; the translations are defined by the users so I have to query them from a translations table. Using an outside class for the current locale might help, I'll put some thinking on it :).
I also thought about rendering all the locales (as I'm not expecting to have more than 3 in almost any case; there should be 2 in average), but I'm not sure if it would be an overhead; also, in every case the locales would only include a name and possibly the description. I like that it would be really decoupled and more reusable (I wouldn't need a separate API call to get locales).
What do you think?

I decided to go with the external class, it now works perfect. Using this gem is really a much more natural and fresh way of working with an API.
Thanks a lot for your help! :)

Glad to head that!
You're welcome. :)


Add User-Agent header

It should be possible to set the User-Agent for the plugin (GrafanaRedshift/v1).

This was added in #106


Turn on formation of Const graph_op's in deabstraction even for the non-strict-deabstraction case

This will start producing graph_op in more cases, and inches towards strict deabstraction being on by default.
This will mostly be about updating testcases, which I'll iterate in the PR.

@swift-ci please test tensorflow

I expect this to fail a bunch of testcases, I'll iterate here in the PR and request review when I converge.


Add Schad token

I agree to not ping anybody on Discord/Twitter/email about this pull request. Instead I will inquire by posting a new comment in the pull request if needed.

PRs are reviewed in bulk and and can take up to two weeks to be merged.
This repository is managed using an auto merge action. Please ensure your PR has no deleted lines, and it will be merged.
Please provide the following information for your token.
Please include change to the src/tokens/solana.tokenlist.json file in the PR.
DON'T modify any other token on the list.
At minimum each entry should have

Token Address: 9pxk5V7qtmcLPdF4AARC1Lztz18A3TuzVSF16XoYoYYW
Token Name: Superchad Token
Token Symbol: schad
Logo: (lhttps://user-images.githubusercontent.com/92108178/137592065-7704c61a-a09d-402a-8a27-367deefbc979.png)
Link to the official homepage of token: https://superchad.io/
Coingecko ID if available (https://www.coingecko.com/api/documentations/v3#/coins/get_coins__id_):

add TOKES token


Update README.md

I fixed a typo.

Wow, I think this used to work a long time ago. Nonetheless, thanks for the fix !


New Record template

We should probably support also this template.
Expected new menu item in C# menu:
|New C#|

| Record template |

Yeah, would be pretty useful. It's quite tedious need to use the class template and adapt it +1

I created an extension that can use custom templates, so you guys don't have to request new templates.
I also added modern C# and legacy C#
https://marketplace.visualstudio.com/items?itemName=TheFish2191.add-items

Record template is there. Don't know when it will be published.

Record template is there. Don't know when it will be published.

Maybe when .NET 8 releases? Would make sense along side with new features such as primary constructors...

this feature is out in 1.8.0


[FLINK-23180] Do not initialize checkpoint base locations when checkp…

What is the purpose of the change
Currently batch jobs will initialize checkpoint location eagerly when CheckpointCoordinator is created, which will create lots of useless directories on distributed filesystem. The change initializes checkpoint base locations only when checkpointing is enabled.
Brief change log

Check whether checkpoint is enabled before initializing base locations.

Verifying this change

#CheckpointCoordinatorTest#testBaseLocationsInitialized: Check that base locations will not be initialized when checkpointing is disabled.

Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): no
The public API, i.e., is any changed class annotated with @Public(Evolving): no
The serializers: no
The runtime per-record code paths (performance sensitive): no
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: Checkpointing
The S3 file system connector: no

Documentation

Does this pull request introduce a new feature? no
If yes, how is the feature documented? not applicable

Please take a look at the conflicts and update this PR then.

Thanks for reminding :). I've resolved the conflicts and squash the commits.

I think current changes look good. However, I think we should still better add a test to verify whether job could still trigger and complete a savepoint if checkpoint folder is not initialized.

I think SavepointITCase has already covered this case, should I create one more in SavepointITCase.java ?

@Jiayi-Liao , I think you still need add a test, and you can debug the SavepointITCase#testTriggerSavepointWithCheckpointingDisabled() to see whether your changes have been covered.

@flinkbot run azure

This PR breaks the contract introduced in https://issues.apache.org/jira/browse/FLINK-11696. The javadoc states the initializeBaseLocations should be called before calling either of initializeLocationForCheckpoint, initializeLocationForSavepoint:
   /**
     * Initializes the necessary prerequisites for storage locations of checkpoints/savepoints.
     *
     * <p>For file-based checkpoint storage, this method would initialize essential base checkpoint
     * directories on checkpoint coordinator side and should be executed before calling {@link
     * #initializeLocationForCheckpoint(long)} and {@link #initializeLocationForSavepoint(long,
     * String)}.
     *
     * @throws IOException Thrown, if these base storage locations cannot be initialized due to an
     *     I/O exception.
     */
    void initializeBaseLocations() throws IOException;

I think in the end there is no harm doing so, but a the very least the javadoc must be updated. I would even suggest renaming initializeBaseLocations to initializeBaseLocationsForCheckpoints.

I think in the end there is no harm doing so, but a the very least the javadoc must be updated. I would even suggest renaming initializeBaseLocations to initializeBaseLocationsForCheckpoints.

I think @dawidwys 's suggestion is right, we should change the javadoc description. Since this class is not annoated as "Public" and might not be extended in user classes, it's fine to rename this method (the renaming commit could be a separate one).

Hey @Myasuka will you follow up on this ticket? I'll leave the final review to you then.

I think in the end there is no harm doing so, but a the very least the javadoc must be updated. I would even suggest renaming initializeBaseLocations to initializeBaseLocationsForCheckpoints.

I think @dawidwys 's suggestion is right, we should change the javadoc description. Since this class is not annoated as "Public" and might not be extended in user classes, it's fine to rename this method (the renaming commit could be a separate one).

@dawidwys @Myasuka  You're right. Will fix this soon...

I think in the end there is no harm doing so, but a the very least the javadoc must be updated. I would even suggest renaming initializeBaseLocations to initializeBaseLocationsForCheckpoints.

I think @dawidwys 's suggestion is right, we should change the javadoc description. Since this class is not annoated as "Public" and might not be extended in user classes, it's fine to rename this method (the renaming commit could be a separate one).

@dawidwys @Myasuka You're right. Will fix this soon...

Hi, I've added two new commits for comment updates and renaming of method. Please take an another look :).

Sorry for the back and forth. I've just started working on https://issues.apache.org/jira/browse/FLINK-24280 where we want to allow manual checkpoints triggering. It would mean checkpoints can be triggered even if the periodic triggering is disabled. It would clearly not work with the changes in this PR.
What do you think about initializing the base paths lazily within the initializeLocationForCheckpoint? I know the idea in FLINK-11696 was to not introduce the laziness, but with the current requirements I think it's worth revisiting. WDYT @Myasuka ?

@dawidwys I think @Jiayi-Liao 's PR is near to merge and you could then rebase on his changes to continue working on the  feature of manual checkpoint only for tests.
For the suggestion that initializing the base paths lazily within the initializeLocationForCheckpoint, I don't think this is a good idea as this should not be done on worker side.  How about initializing the locations when you first trigger the manual checkpoint on coordinator side?

Isn't the initializeLocationForCheckpoint called only from the CheckpointCoordinator?

Isn't the initializeLocationForCheckpoint called only from the CheckpointCoordinator?

Sorry, it's my bad to mix this with worker-view's resolveCheckpointStorageLocation. However, initializeLocationForCheckpoint would not create the shared and task-owned folders, I think lazily called initializeBaseLocationsForCheckpoint might be better.

@flinkbot run azure

It seems CI failed due to https://issues.apache.org/jira/browse/FLINK-24305, @Jiayi-Liao please consider to rebase latest master branch.

@flinkbot run azure


rm sys.path.append in main python file

avoid to raising error when there is a foler or python file that has same name in working directory

fix #1325 #2163


Add Instalation instructions

:tada: This PR is included in version 2.2.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


use query params help

Hi there,
Got the plugin all installed and working in the sense that it updates the setQuery hook and the URL updates, but the 'query' variable doesn't update also - it stays at whatever the option was on the page load.
Any ideas why this is?

Can you double-check that you have "gatsby-plugin-use-query-params" in your gatsby-config.js file?
If that's not the issue, a simple Codesandbox reproduction would be very helpful! Thanks

That was the issue (ugh, sorry), but not it's snapping to the top of the page each time.
Will see if I can debug why unless you happen to know? :-p

Can you elaborate a bit? I'm not sure I fully understand what the issue is.

Updating the query string essentially triggers a full page reload (thus snapping the page back to the top rather than remaining in place). Assumed that wasn't the intended output unless I've misunderstood.

Oh I see. This sounds like an upstream issue? If you can provide a sample CodeSandbox reproduction, I'd be happy to take a look into it!

Got one setup here: https://codesandbox.io/s/dreamy-mcclintock-1nqmb
There's a select field down the bottom of the page - if you choose an item, then it snaps back to the top.

Wondered if you'd had an opportunity to look at this? :-)

Updating the query string essentially triggers a full page reload (thus snapping the page back to the top rather than remaining in place). Assumed that wasn't the intended output unless I've misunderstood.

A solution that worked for me can be found here https://github.com/alexluong/gatsby-packages/issues/33#issuecomment-660541167 Here's a demo with my test fork: https://codesandbox.io/s/busy-northcutt-tj240
Note that it still jumps to the top when resetting to "Any" since I'm merely checking for the presence of ? in window.location.search; it might be useful to check window.location.pathname too (and expose it in pluginOptions) or otherwise.


[UI Design] Re-authorization of Access

Task
Define Re-authorization of Access use cases

Task Title
[UI Design] Re-authorization of Access

User Story
link associated User Story for this task

Epic
link associated Epic, if applicable

T-shirt size default is S(mall)
S

Story Points - Fibonacci (1,2,3,5)
3

Description
Define workflow & mock-ups for Re-authorization of Access use cases

Business Need (the why):

Applications or Systems impacted

Dependencies

Assumptions
if any

re-auth UI doesn't need any further work...  closing


Modify for Meteor 1.3 beta

How would I modify the buildpack to use one of the beta releases of Meteor 1.3? I have no experience modifying buildpacks so was wondering if this is trivial or a much bigger task.

saw there was a previous issue


Added the setDeviceName functionality while BLE is running

Created the functionality I needed from #420 as per @h2zero requested.

Perfect, thanks!


Support global install of packages

By installing items in a folder in /usr/local with a template file.
Similar to this recipe: https://github.com/escapestudios-cookbooks/phpcs/blob/master/recipes/composer.rb, but then in a LWRP. I can make it, but I'd first check if there's a need for this (I think there is) and if this could make it in :)

Hi @daften,
am I right to understand this is also covered in #53?
Thanks in advance!

Jup, indeed!


Running tests

How do you run tests with this tool?
Setting the environmental variable to the this project errors because the scripts cant find the output dir:
UpgradeRR  Error  output//Users/mandalarian/Github/upgrade-reason-react-esy/test/cases/App.re
Sys_error("output//Users/mandalarian/Github/upgrade-reason-react-esy/test/cases/App.re: No such file or directory")
/Users/mandalarian/Github/upgrade-reason-react-esy/test/cases/MultiModules.re
 UpgradeRR  Error  output//Users/mandalarian/Github/upgrade-reason-react-esy/test/cases/MultiModules.re
Sys_error("output//Users/mandalarian/Github/upgrade-reason-react-esy/test/cases/MultiModules.re: No such file or directory")

Its putting an extra / after output and before the dir name.
output//Users/mandalarian/Github/upgrade-reason-react-esy/test/cases/App.re

How did you and that?
Thank, brother.

What OS are you using?

macOS Catalina


My comments on response_ori_rev.md

You probably do not want to merge it, but I thought it is helpful to have the comments in the file.
Nice response in general! Good points and kindly written!

Thanks Jan, I went through them and incorporated changes in commit 1f96954e18d2cbf9012647991134eeb224bfb3a2


Import observation from iNat into MO

Provide link from an MO observation to an iNat observation.
Create an MO observation based on an iNat observation.
Enable MO to review a user's observations on iNat and see which have corresponding MO observation.
Enable background job to sync iNat observations into MO.

iNat API documents:

https://api.inaturalist.org/v1/docs/
https://www.inaturalist.org/pages/api+recommended+practices

To play with API requests:

Go to  iNaturalist API
Scroll down to the list of objects
Click on an object (e.g. Observations)
Click an Operation (e.g. GET Observations aka Observation Search)

Here is a A very simple API request for a single iNat Observation (202555552). It returns tons of data.
https://api.inaturalist.org/v1/observations?id=202555552

Authentication (How to get authentication to retrieve iNat private data.)

I should probably with importing a single iNat Observation, deal with authentication later.

test/fixtures/inat/one_obs_public.json
(in https://github.com/MushroomObserver/mushroom-observer/tree/jdc-1955-inat-import)
is what this returns
HTTParty.get("https://api.inaturalist.org/v1/observations?id=202555552&order=desc&order_by=created_at&only_id=false")

It's a search for a single iNat obs, 202555552, without authenticating, so it just returns public data.
I 'd like to stub that request,bu I'm having issues with understanding/converting raw string to JSON.
So to move forward I will stub something more abstract.

Some "fixture" files, in test/fixtures/inat/:

one_obs_public.txt What iNat API returns for an observation search for obs iNat 202555552
one_obs_public.json The above as json. Handy because it's more readable than the above, but not really used in tests.

Photos
They're in aws.
pseudocode:
obs[:observation_photos].each do |photo|
  aws_id = photo[:photo_id]
  import this: https://inaturalist-open-data.s3.amazonaws.com/photos/<aws_id>/original.jpeg`
end

to get image to local tmp file (per Copilot)
require 'open-uri'

url = 'http://example.com/image.png' # Replace with the actual image URL
local_file_path = Rails.root.join('tmp', 'image.png') # Specify the local file path

# Download the image and save it locally
IO.copy_stream(open(url), local_file_path)

# Now `local_file_path` contains the downloaded image

Tempfile Class: The Tempfile class in Ruby provides a convenient way to manage temporary files. When you create a Tempfile object, it automatically generates a unique filename in the OS’s temp directory. You can perform standard file operations on it, such as reading, writing, and changing permissions. Here’s how you can use it:
require 'tempfile'

file = Tempfile.new('foo')
file_path = file.path # A unique filename in the OS's temp directory
file.write('hello world')
file.rewind
content = file.read
file.close
file.unlink # Deletes the temp file

How do I copy an image from an external website to a (temp) file on the server?
Nathan Wilson<EMAIL_ADDRESS>Sun, Apr 21, 2024 at 5:04 AM
...
At least leveraging the code in the API makes sense to me.  Not sure it's worth creating a service that just translates between the APIs, but it would be cool and might get us to at least improve the online documentation around our API.  I heard at last year's NAMA foray that ChatGPT is better at creating code using the iNat API than the MO API.  I think Alan has looked at that and might have some examples.

On Sun, Apr 21, 2024 at 12:19 AM Jason Hollinger<EMAIL_ADDRESS>wrote:
Yes, check out around line 58 of app/classes/api2/core/uploads.rb for one possible solution.
It might be altogether a dumb idea to literally just use the API to accomplish your whole task.

How do I copy an image from an external website to a (temp) file on the server?
Nathan Wilson<EMAIL_ADDRESS>Sun, Apr 21, 2024 at 5:04 AM ... At least leveraging the code in the API makes sense to me. Not sure it's worth creating a service that just translates between the APIs, but it would be cool and might get us to at least improve the online documentation around our API. I heard at last year's NAMA foray that ChatGPT is better at creating code using the iNat API than the MO API. I think Alan has looked at that and might have some examples.

On Sun, Apr 21, 2024 at 12:19 AM Jason Hollinger<EMAIL_ADDRESS>wrote:
Yes, check out around line 58 of app/classes/api2/core/uploads.rb for one possible solution.
It might be altogether a dumb idea to literally just use the API to accomplish your whole task.

I'd either use system to call one of the standard command line tools for this (curl or wget) or I'd explore a Ruby library like Open::URI. See https://stackoverflow.com/questions/6768238/download-an-image-from-a-url

Good to know, i was wondering the same thing. We use File class methods all over MO.
In the stack overflow answer:
I'd go after the file using Ruby's Open::URI:
require "open-uri"
File.open('pie.png', 'wb') do |fo|
fo.write open("http://chart.googleapis.com/chart?#{failures_url}").read
end
I wondered, how is he using Open::URI here, though?
The answer seems to be that any URL that begins with protocol:// protocol://` is parsed by URI if File.open is called.

On May 3, 2024, at 1:33 PM, Nathan Wilson @.***> wrote:
How do I copy an image from an external website to a (temp) file on the server?
Nathan Wilson @.*** @.***> Sun, Apr 21, 2024 at 5:04 AM ... At least leveraging the code in the API makes sense to me. Not sure it's worth creating a service that just translates between the APIs, but it would be cool and might get us to at least improve the online documentation around our API. I heard at last year's NAMA foray that ChatGPT is better at creating code using the iNat API than the MO API. I think Alan has looked at that and might have some examples.
On Sun, Apr 21, 2024 at 12:19 AM Jason Hollinger @.*** @.***>> wrote:
Yes, check out around line 58 of app/classes/api2/core/uploads.rb for one possible solution.
It might be altogether a dumb idea to literally just use the API to accomplish your whole task.
I'd either use system to call one of the standard command line tools for this (curl or wget) or I'd explore a Ruby library like Open::URI http://rubydoc.info/stdlib/open-uri/1.9.2/frames. See https://stackoverflow.com/questions/6768238/download-an-image-from-a-url https://stackoverflow.com/questions/6768238/download-an-image-from-a-url
—
Reply to this email directly, view it on GitHub https://github.com/MushroomObserver/mushroom-observer/issues/1955#issuecomment-2093724355, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO3TPY5QZBM4JSQZSON2JLZAPYCRAVCNFSM6AAAAABDV2T2AGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJTG4ZDIMZVGU.
You are receiving this because you are subscribed to this thread.

From README_API.md

POST https://mushroomobserver.org/api2/observations?api_key=xxx&name=Agaricus&location=Pasadena,+California,+USA&date=2016-08-06&notes=growing+in+lawn

The response will include the id of the new record.
Attach the image as POST data or URL.  See script/test_api for an example of how to attach an image in the POST data.

There is no script/test_api.
Maybe test/controllers/api2_controller_test.rb#test_post_maximal_image?
  def test_post_maximal_image
    setup_image_dirs
    rolf.update(keep_filenames: "keep_and_show")
    rolf.reload
    file = Rails.root.join("test/images/Coprinus_comatus.jpg").to_s
    proj = rolf.projects_member.first
    obs = rolf.observations.first
    File.stub(:rename, false) do
      post_and_send_file(:images, file, "image/jpeg",
                         api_key: api_keys(:rolfs_api_key).key,
                         vote: "3",
                         date: "20120626",
                         notes: " Here are some notes. ",
                         copyright_holder: "My Friend",
                         license: licenses(:ccnc30).id.to_s,
                         original_name: "Coprinus_comatus.jpg",
                         projects: proj.id,
                         observations: obs.id)
    end
    ...
  end

  def post_and_send_file(action, file, content_type, params)
    body = Rack::Test::UploadedFile.new(file, "image/jpeg").read
    md5sum = file_checksum(file)
    post_and_send(action, body, content_type, md5sum, params)
  end

  def post_and_send(action, body, content_type, md5sum, params)
    @request.env["CONTENT_TYPE"] = content_type
    @request.env["CONTENT_MD5"] = md5sum
    post(action, params: params, body: body)
  end

Better: test/models/api2_test.rb#test_posting_image_via_url
  def test_posting_image_via_url
    setup_image_dirs
    url = "https://mushroomobserver.org/images/thumb/459340.jpg"
    stub_request(:any, url).
      to_return(Rails.root.join("test/images/test_image.curl").read)
    params = {
      method: :post,
      action: :image,
      api_key: @api_key.key,
      upload_url: url
    }
    File.stub(:rename, false) do
      api = API2.execute(params)
      assert_no_errors(api, "Errors while posting image")
      img = Image.last
      assert_obj_arrays_equal([img], api.results)
      actual = File.read(img.local_file_name(:full_size))
      expect = Rails.root.join("test/images/test_image.jpg").read
      assert_equal(expect, actual, "Uploaded image differs from original!")
    end
  end

Following is returns by API help request http://localhost:3000//api2/images?help=1
{
"version": 2,
"run_date": "2024-05-04T11:40:53.075Z",
"errors": [
{
"code": "API2::HelpMessage",
"details": "Usage: confidence: confidence range (limit=-3..3); content_type: enum list (limit=bmp|gif|jpg|png|raw|tiff); copyright_holder_has: string (search within copyright holder); created_at: time range; date: date range (when photo taken); has_notes: boolean; has_observation: boolean (limit=true, is attached to an observation?); has_votes: boolean; id: integer list; include_subtaxa: boolean; include_synonyms: boolean; license: license; location: location list; name: name list; notes_has: string (search within notes); observation: observation list; ok_for_export: boolean; project: project list; quality: quality range (limit=1..4); size: enum (limit=huge|large|medium|small|thumbnail, width or height at least 160 for thumbnail, 320 for small, 640 for medium, 960 for large, 1280 for huge); species_list: species_list list; updated_at: time range; user: user list (who uploaded the photo)",
"fatal": "true"
}
],
"run_time": 0.017291
}

Is iNat Obs in Fungi?
Taxa page for Fungi: https://www.inaturalist.org/taxa/47170-Fungi_
So [:taxon][:ancestor_ids] must include 47170
alternative: [:taxon][:iconic_taxon_name] == "Fungi"

iNat Projects Issue.
I cannot reliably get an iNat observation's Projects via the new API.
Apparently I can get it from the old API. https://www.inaturalist.org/pages/api+reference#get-observations

for contains_box, I need to have a (separate?) scope which generalizes this (from #2183)
  scope :contains, # Use named parameters (lat:, lng:), any order
        lambda { |**args|
          args => {lat:, lng:}
          where(
            Location[:south].lteq(lat).and(Location[:north].gteq(lat)).
            and(
              Location[:west].lteq(lng).and(Location[:east].gteq(lng)).or(
                Location[:west].gteq(lng).and(Location[:east].lteq(lng))
              )
            )
          )
        }

How about something like this, that takes advantage of named arg assignment:
  scope :contains, # Use named parameters (lat:, lng:, or north:, south:, east:, west:), any order
        lambda { |**args|
          if args.lat.present? && args.lng.present?
            args => {lat:, lng:}
            north = south = lat
            east = west = lng
          else if args.north.present?
            args => {north:, south:, east:, west:}
          end
          where(
            Location[:south].lteq(south).and(Location[:north].gteq(north)).
            and(
              Location[:west].lteq(west).and(Location[:east].gteq(east)).or(
                Location[:west].gteq(west).and(Location[:east].lteq(east))
              )
            )
          )
        }

Not sure about all that, but something like that.

@nimmolo Yes. That looks right.  Needs some tests, especially for e/w.
What's the best procedure for adding this:

stand-alone PR vs. main?
include it in #1955?
include it in #2183?
stand-alone PR vs #2183?
other?

I'd say do it as a standalone PR vs main. We have plenty of scopes as yet unused, and one more won't hurt — plus of course I'll use the lat/lng part in my next PR.

Thanks. Will do.
On Fri, Jun 28, 2024 at 4:24 PM andrew nimmo @.***>
wrote:

I'd say do it as a standalone PR vs main. We have plenty of scopes as yet
unused, and one more won't hurt — plus of course I'll use the lat/lng part
in my next PR.
—
Reply to this email directly, view it on GitHub
https://github.com/MushroomObserver/mushroom-observer/issues/1955#issuecomment-2197765438,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAALDFF76ZJJ3EEWBG7L3ZDZJXWEFAVCNFSM6AAAAABDV2T2AGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJXG43DKNBTHA
.
You are receiving this because you were assigned.Message ID:
@.***>

iNat API Recommended Practices

mirror adds string like this to Notes:
Mirrored on iNaturalist as observation 194293541 on December 18, 2023.


Debugger: [Unstable] The call stack frame incorrectly

Environment data
dotnet --info output:
OS: debian.8-x64
VS Code version: 1.8.1
C# Extension version: 1.6.2
.NET Core version: 1.0.0-preview2 - 003121
Steps to reproduce

Download hwapp folder in attachments directly and open with VSCode
hwapp.zip
Select the debug type ''.Net core Launch(console)"
Press F5 to start debugging

Expected  behavior
When the cursor hit 'Debugger.Break()', call stack frame should as follow:

Actual behavior
The call stack frame as follow:

Investigation
This issue doesn't appear every time. I try to test ten times, it can repro five times.

@GraceDong Can you include a log?

I collected a log, hope to help you analyze.
log.txt