File Save Permissions Error

Hi 👋
First off just wanted to say thanks for the project, it's been a breeze to setup and super refreshing! -- Good work!
My question is currently whether or not this library is suppose to support physical devices or if the intended use is limited to Simulators?
When running on a physical device I get the below error when fileManager.createDirectory is called. The same is not true when ran from a simulator (which works as expected, without errors).
Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CaseNameTests” in the folder “__Snapshots__”." UserInfo={NSFilePath=/Users/name/path/to/repo/ModuleTests/__Snapshots__/CaseNameTests, NSUnderlyingError=0x1c28585d0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

This appears to be the same issue referenced here
Thanks in advance 😄

Hi @Sherlouk! We recently added snapshotDirectory to the base verifySnapshotHelper: https://github.com/pointfreeco/swift-snapshot-testing/blob/5ae8db2a9cad57a698883fdad9e40b72654fd3dc/Sources/SnapshotTesting/AssertSnapshot.swift#L161
This means you can write your own assertSnapshot helper to change the directory in which the images are saved:
https://github.com/pointfreeco/swift-snapshot-testing/blob/5ae8db2a9cad57a698883fdad9e40b72654fd3dc/Sources/SnapshotTesting/AssertSnapshot.swift#L117-L143
We know this is a bit hidden and that the ergonomics aren't great, so we hope to improve the experience in the future.

Apologies in the delay getting back to you @stephencelis - I've updated my references to assert with my own implementation loosely following the example you showed above using a different directory in the top-level of my projects file structure but unfortunately am getting the same error (just paths updated to a different location).
Again, this is only happening when ran from a device - working fine from Simulator 😞Is there something different happening in file permissions when running from device?

I'll add that I've just done a further investigation with uber/ios-snapshot-test-case and they're getting the exact same issue where on device it doesn't save images, and on simulator it does.
From looking at the code it appears both implementations do more or less the same thing (using FileManager to create directories, and then image.save(to:) into the file location.
Interested in your opinion on this?

Hi @Sherlouk, sorry for the delay! While we've written a ton of snapshot tests we've never had the need to do so outside of a simulator. Could you describe your use case a bit more? We'd be happy to accommodate this at the library level if it's possible and useful, but we haven't had the need to implement such functionality ourselves.

No problem! More than happy to try and explain our use case a bit more,
Internally we have a CI platform that supports a large number of physical devices ranging from phones through tablets of varying sizes and configurations. We take advantage of Hive CI to run our integration tests on and were hoping to also take advantage of it for our snapshot tests too.
In general this comes down to a bit of reassurance from our testing department as we have seen various little differences in the past when it comes to Simulator vs Physical Device and was hoping to do the comparison on the closest thing to real world as possible
Hope that makes sense?

I'm running into this error while trying to see snapshots to disk in a macOS test environment. Is there an extra set of config for Mac testing?

Same problem here. I just created a new macOS app project, added the Snapshots project and tried to run a simple test.
I think the problem is that the test run sandboxed on macOS. The question is how to extend the app sandbox so that the unit tests can write the snapshots to a given directory (and not only the temporary directory).
To reproduce:

Open Xcode, create a new Cocoa application
Add the Snapshots project
Create a simple test : assertSnapshot(matching: "Hello", as: .lines)

Result:
Test fails with: "failed - You don’t have permission to save the file “BasicTests” in the folder “Snapshots”"

Hi,
Also running into the same issue, only when running the Snapshot test on a real device. We needed to switch to testing on a real device as we incorporated a SDK that does not support Simulators (no x86_64 slice available)
Any ideas on how to resolve this

I was able to work around this by disabling app sandboxing for the test host app.
in Entitlements.plist:
+        <key>com.apple.security.app-sandbox</key>
+        <false/>

Hi @stephencelis,
I tried writing my own assertSnapshot in order to change the output directory, and my error is similar, but not exactly the same:
failed - You can’t save the file “MyTests” because the volume is read only.
I tried replicating the default behaviour, but the error still occurs.
public var snapshotDirectory: String {
    let fileUrl = URL(fileURLWithPath: "\(#file)", isDirectory: false)
    let fileName = fileUrl.deletingPathExtension().lastPathComponent

    return fileUrl.deletingLastPathComponent()
        .appendingPathComponent("__Snapshots__")
        .appendingPathComponent(fileName)
        .absoluteString
 }

public func myAssertSnapshot<Value, Format>(
    matching value: @autoclosure () throws -> Value,
    as snapshotting: Snapshotting<Value, Format>,
    named name: String? = nil,
    record recording: Bool = false,
    timeout: TimeInterval = 5,
    file: StaticString = #file,
    testName: String = #function,
    line: UInt = #line
) {
    let snapshotDirectory = snapshotDirectory
    let failure = verifySnapshot(
        matching: try value(),
        as: snapshotting,
        named: name,
        record: recording,
        snapshotDirectory: snapshotDirectory,
        timeout: timeout,
        file: file,
        testName: testName
    )
    guard let message = failure else { return }
    XCTFail(message, file: file, line: line)
}

This is the default code, in AssertSnapshot.swift:
      let fileUrl = URL(fileURLWithPath: "\(file)", isDirectory: false)
      let fileName = fileUrl.deletingPathExtension().lastPathComponent

      let snapshotDirectoryUrl = snapshotDirectory.map { URL(fileURLWithPath: $0, isDirectory: true) }
        ?? fileUrl
          .deletingLastPathComponent()
          .appendingPathComponent("__Snapshots__")
          .appendingPathComponent(fileName)

It seems snapshotDirectory.map { URL(fileURLWithPath: $0, isDirectory: true) } and fileUrl.deletingLastPathComponent().appendingPathComponent("__Snapshots__").appendingPathComponent(fileName) don't output the exact same thing:

snapshotDirectory.map { URL(fileURLWithPath: $0, isDirectory: true) } outputs file:/Users/benoit/myApp/myApp-iOSTests/__Snapshots__/MyTests/ -- file:///

this one doesn't work

fileUrl.deletingLastPathComponent().appendingPathComponent("__Snapshots__").appendingPathComponent(fileName) outputs file:///Users/benoit/myApp/myApp-iOSTests/__Snapshots__/MyTests/

this one works

Why is there a difference? Am I missing something?

I also have this issue with MacOS.  @BenoitCaron does this solve it for MacOS too?

Sorry I wouldn't know, my project is iOS.

Hi @BenoitCaron and @fabstu , I ran into the same issue on macOS. What solved it for me was to convert the URL to string with .path() instead of ..absoluteString() in my custom myAssertSnapshot, like so
let snapshotDirectory = createSnapshotDirectory(file: file) // returns URL

let failure = verifySnapshot(
      matching: value,
      as: snapshotting,
      named: name,
      record: recording,
      snapshotDirectory: snapshotDirectory.path,
      timeout: timeout,
      file: file,
      testName: testName,
      line: line
    )

I fixed this by selecting Expand Variables Based On and selecting the based Target. It fixed for me.

Same problem
Doesn't have permission to create image in Snapshots directory
Any solutions?

That happens to me from time to time, when changing branches. Deleting the whole directory and recreating snapshots usually works for me.

I was also getting the same error when using https://github.com/cashapp/AccessibilitySnapshot.
For me the issue was absoluteString
fixtureProvider.snapshotDirectory(forTestFile: file).absoluteString
changing to
fixtureProvider.snapshotDirectory(forTestFile: file).path
worked for me.
this forum helped me - https://www.hackingwithswift.com/forums/ios/trying-to-create-directory-in-documents-folder-fails/15774/15788

I am having same issue as others described for iOS device.
I wanted to check real device, because for some reason code coverage is not gathered on simulator.
It is gathered just fine for physical device, but I am getting
failed - You don’t have permission to save the file “CalendarLargeWidgetViewSnapshotTests” in the folder “__Snapshots__”.  failure in tests :)

I wanted to share how I worked around this issue for myself. I don't run tests against a real host app, so removing the sandboxing isn't an option (and I wouldn't really want this anyways).
Instead, I wrote a custom version of assertSnapshot (as recommended above). To access files, my version reads from the target's resource bundle (fixture images are part of the test target) using bundle.urlForImageResource, and writes to the application's temporary directory. Logging shows me where everything is, so I just have to manually copy the written file back to my source directory.
The code is a little messy since it needs to duplicate a lot of this package's code, and I've adjusted a bit for swift-testing, but it works pretty well for me.


do not set a value if the column length is -1

If the value of a field is null the length is -1. So the following byte should not be readed. I've testet it with Cassandra Version 2.
Regards,
Pascal

In Cassandra version <IP_ADDRESS> everything is working fine with your fix. Thank you very much!
I've tested with PHP version 5.4.14 on Windows and Linux. Master commit is bugged, but this fix solves everything.
Please evseevnn, merge the pull request rom pascaln in master.
Thank you,
Fabiano


Add missing glibmm-2.4 to nordugrid-arc

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.


Inference with own image

How do I transform my own images in a tf_record either to run on training or inference, (OCR, then stablishing vertext, etc ) ?
Thank you, this is a nice project.

@hasslercastro i have the same question, did you solve it?

You can adapt your files to the format used in the Google Drive mentionned on the GitHub page: https://github.com/hassan-mahmood/TIES_DataGeneration


Cannot Change temperature

If I have my Homebridge on I cannot change the temperature in the Honeywell Home app.  It changes and then changes back to the previous temp.   I get the same error if I change the temp in Homekit.
I get the following:
HoneywellHome] Sending request for Family Room Thermostat to Honeywell API. mode: Heat coolSetpoint: 78 heatSetpoint: 66 thermostatSetpointStatus: undefined
[HoneywellHome] "Request failed with status code 400"
If I turn off my Homebridge the app works.  I can change the temp and it stays.

Change temp and you will see the temp change back within 10-20 seconds.

Change and stay via Honeywell App or HomeKit

Logs:

Show the Homebridge logs here. If using Homebridge Config-UI-X, you can easly downlaod your log by visiting the log page on the UI and Clicking the Download Icon in the top right.
Remove any sensitive information, such as your homebridge-honeywell-home refreshToken.

Please Turn on Debug Mode before submitting your Issue so more logs can be shared to fix the issue being submitted.

There is a hidden `"devicediscovery: true"` option that you can add to your config that will output data about your device to your log also.

***Read and Paste over this Text the Text Above^^^^^^

Homebridge Config:
Paste your homebridge config.json here.
Remove any sensitive information, such as your homebridge-honeywell-home consumerKey/ consumerSecret / refreshToken.

            "platform": "HoneywellHome",
            "consumerSecret":
            "consumerKey": "
            "credentials": {
                "consumerKey":
                "consumerSecret": "
                "accessToken": "
                "refreshToken": "
            }
        }
    ]
}

***Read and Paste over this Text the Text Above^^^^^^

Screenshots:

Device & Model:

Environment:

Node.js Version:  v14.15.4
NPM Version:  v6.14.11
Homebridge Version:  Homebridge v1.3.0-beta.47
Homebridge Honeywell Home Plugin Version: homebridge-honeywell-home v8.3.2
Homebridge Config UI X Plugin Version: homebridge-config-ui-x v4.36.0
Operating System:  Windows

@cherk947 Can you fill in the bottom part of the template so know what device you have? Version of your plugin..., etc.

@cherk947 Can you fill in the bottom part of the template so know what device you have? Version of your plugin..., etc.

@donavanbecker sorry thought I saved that the first time.  Updated

@donavanbecker sorry thought I saved that the first time.  Updated

@donavanbecker sorry thought I saved that the first time.  Updated

What about device? Which device are you using?

@donavanbecker sorry thought I saved that the first time.  Updated

What about device? Which device are you using?

I have three Honeywell T9 with Sensors.

I have three Honeywell T9 with Sensors.

Awesome! Can you provide debug logs?

Awesome! Can you provide debug logs?

homebridge.log-2.txt
Not seeing the failure this evening.  Will continue to monitor and will pass logs once the failure occurs again.  You should see the previous events earlier in the logs

homebridge.log-2.txt
Not seeing the failure this evening.  Will continue to monitor and will pass logs once the failure occurs again.  You should see the previous events earlier in the logs

@donavanbecker I did some more testing this evening.  I found that if I turn off my Homebridge or unlink the plugin the Honeywell app works fine.  As soon as I turn on my Homebridge or re-link the app my issue with changing the temp in the Honeywell App or via HomeKit does not set.  It resets in a few seconds.  In the Honeywell App I see the temp go to zero for a second or two then resets back to the previous temperature setting.

@donavanbecker I did some more testing this evening.  I found that if I turn off my Homebridge or unlink the plugin the Honeywell app works fine.  As soon as I turn on my Homebridge or re-link the app my issue with changing the temp in the Honeywell App or via HomeKit does not set.  It resets in a few seconds.  In the Honeywell App I see the temp go to zero for a second or two then resets back to the previous temperature setting.

Looks like everything is working. Updated my UI to the latest.  Don't think that has anything to do with it but... you never know

Looks like everything is working. Updated my UI to the latest.  Don't think that has anything to do with it but... you never know

Awesome

Awesome

Same issue here since I've updated to 8.4.0.
8.3.2 works fine. I'm only using HomeKit, not the Honeywell app.

Same issue here on Lyric T5 (i will change the temp on the plugins thermostat and then on the native thermostat in homekit i won't see the temp change)

One thing I tired that has seemed to be successful is to unlink the account in HB and then delete the app on the Honeywell portal.  Create a new one.  This has worked for me

One thing I tired that has seemed to be successful is to unlink the account in HB and then delete the app on the Honeywell portal.  Create a new one.  This has worked for me

Didn't work for me.

If you are having issues. Each person Please open a new issue so I can get info about your setup to get this resolved.

Updated to homebridge-honeywell-home v8.4.0 and we are broken again.  :(

@cherk947 not really sure what to tell you. I didn't really change much with T9 if you want to compare https://github.com/donavanbecker/homebridge-honeywell-home/compare/v8.3.2...v8.4.0

It might be a Honeywell Server thing. I am going to close this. If it happens tomorrow please open a new issue.

@cherk947 what Is your Devices Units? Fahrenheit or Celsius

@donavanbecker where does that screenshot come from? I'm experiencing problems as well with my Honeywell thermostat.
I cannot alter the temperature from homekit or the homebridge-UI. It just jumps back to its original state.
When I change the temperature via the honeywell app the thermostat will update to the desired temperature and starts heating. After a while the correct temperature is updated in the home.app and the homebridge UI as well. So polling the current state works, but updating the temperature through homekit/homebridge returns a Request failed with status code 400.

@bramsmulders Please open your own issue to track your issue.

@donavanbecker  Yes in Fahrenheit and it is still not working.  I dont even see the attempt in the logs when I change the temp via the Honeywell app or HomeKit

Issue is still occurring today.

Please revert to 8.3.2 till I get a fix out.

Thanks @donavanbecker   It looks to be working.  Thanks again for all your hard work on this plugin

@cherk947 I am going to work on a big overhaul on the plugin so might take a little bit. I will need beta testers and will post it in the issues when ready.

Always be glad to beta test!
From: Donavan Becker<EMAIL_ADDRESS>Sent: Wednesday, February 10, 2021 2:46 PM
To: donavanbecker/homebridge-honeywell-home<EMAIL_ADDRESS>Cc: cherk947<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: Re: [donavanbecker/homebridge-honeywell-home] Cannot Change temperature (#395)
@cherk947 https://github.com/cherk947  I am going to work on a big overhaul on the plugin so might take a little bit. I will need beta testers and will post it in the issues when ready.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/donavanbecker/homebridge-honeywell-home/issues/395#issuecomment-776968904 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQUCTQNL3HGSFOFWPXV7QILS6LO5VANCNFSM4WPLW27Q .

@cherk947 @bramsmulders @yonigold1 @AbeltjeNL
Please see #414.


Cleanup getUniswapV3Pool docs and internal naming

PR-Codex overview
This PR updates the naming and structure of Uniswap V3 pool functions and types.
Detailed summary

Renamed getUniswapV3Pools to getUniswapV3Pool
Updated type names from GetUniswapV3PoolsParams to GetUniswapV3PoolParams and GetUniswapV3PoolsResult to GetUniswapV3PoolResult
Updated function parameters and return types accordingly

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@gregfromstl does this need a changeset, it seems like no public api changed in any way?

@jnsdls no public API change, but public docs so... yes?


Suggestion for escaped parenthesis

Hi, Cool tool
I just unexpectedly got a visit from the pep8speaks fairy when PR'ing pandas.
I was changing some code that had no brackets and was matching an exception using a pytest.raises context block.
It's not a feature I use, as I think scanning exceptions for details can be problematic, but I wanted to keep test logic as it was in a style of that project.
In any case I did not realize the intention of the code was to pattern match, so when running it would fail, and the only way to have it pass is to remove the parenthesis, or escape them.
I added r modifier to the string and flake8 and this tool accepted the correction, so I was wondering if it might be worth a PR to add a suggestion / note to the error message to say something along the lines of.

We've noticed you're escaping parenthesis. This should only be necessary for regex string patterns. If this is the case, add the r modifier to the start of your string and escape parenthesis.

This tool and flake, and black did not complain about rf modifiers, but I've no idea if it should be fr in such a case that it matters to anyone, perhaps a code snippet underneath (can be non-digetic) might help people further understand.

Hi Lewis!
Thank you for creating the issue. The idea of suggesting changes based on the errors are worth exploring.
The suggestion seems like something a linter should do. PEP 8 Speaks is merely a wrapper over the linters pycodestyle and flake8. If these linters start giving suggestions like you wrote above, then PEP 8 Speaks should comment the same too.
I am not aware if these linters print out any suggestions like these currently. Let me know if you are aware. :)

I should have read the code to make sure the problem was here. I may look at the tools.


Prevent pings by the bot (most importantly @everyone)

Previously it was possible to use @everyone and @here even when the bot didn't have permissions for this (I assume that's because it's using a webhook?). This can be really problematic, if someone abuses it, it is hugely annoying to everyone on the server, and I don't think you can really do anything about it as a server admin.

Looks good to me!


Cannot store matplotlib.pyplot figure objects with dependence_plot instead of plotting them

When using shap.dependence_plot, how do I store the figure objects in a variable (to use later) instead of directly plotting them?
I got it to work when using shap_values, but can't get it to work with shap_interaction_values. This is what I've done: in the shap.dependence plot function definition, I replaced pl.show() with fig = pl.figure() in the beginning and return fig in the end. So, there are 2 places where return fig appears - one when using shap_interaction_values, where its a recursive function call, where I replaced
if show:
     pl.show()
     return

with return fig, and one at the end of the function where I replaced
if show:
     pl.show()

with return fig.
This works with shap_values like so, where it doesn't plot anything and stores the figure object in the variable:
lis = []
for i in features:
    mpl_fig = shap_dependence_plot ( i, shap_values, X )
    plotly_fig = mpl_to_plotly(mpl_fig)
    lis.append(plotly_fig)
lis

But it doesn't work when using shap_interaction_values, because it tries to plot the figure:
lis = []
for i in features:
    for j in features:
        mpl_fig = shap_dependence_plot ( (i, j), shap_interaction_values, X )
        plotly_fig = mpl_to_plotly(mpl_fig)
        lis.append(plotly_fig)
lis

Because it tries to plot the figure, I get an error saying that it can't get the figure bounds (which is required when converting it to a plotly figure object). This is demonstrated by the following code trying to get the axis bounds, which works when using shap_values and gives error when using shap_interaction_values:
x_min, x_max, y_min, y_max = [], [], [], []
for axes_obj in mpl_fig.get_axes():
    bounds = axes_obj.get_position().bounds
    x_min.append(bounds[0])
    x_max.append(bounds[0]+bounds[2])
    y_min.append(bounds[1])
    y_max.append(bounds[1]+bounds[3])
x_min, y_min, x_max, y_max = min(x_min), min(y_min), max(x_max), max(y_max)

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-82-03390f6b487d> in <module>()
     13     y_min.append(bounds[1])
     14     y_max.append(bounds[1]+bounds[3])
---> 15 x_min, y_min, x_max, y_max = min(x_min), min(y_min), max(x_max), max(y_max)

ValueError: min() arg is an empty sequence

Further drilling down,
mpl_fig = shap_dependence_plot(i, shap_values, X)
len(mpl_fig.get_axes())
>>> 2

But:
mpl_fig = shap_dependence_plot((i, j), shap_interaction_values, X)
len(mpl_fig.get_axes())
>>> 0

So, it would be a great help if you could kindly point to how I could get it to not plot and just store the figure object.

Could you post the whole modified version of the function? It is hard to see what might be wrong without seeing it all together.

Sure. Here it is:
def shap_dependence_plot(ind, shap_values, features, feature_names=None, display_features=None,
                    interaction_index="auto", color="#1E88E5", axis_color="#333333",
                    dot_size=16, alpha=1, title=None, show=True):
    """
    Create a SHAP dependence plot, colored by an interaction feature.

    Parameters
    ----------
    ind : int
        Index of the feature to plot.

    shap_values : numpy.array
        Matrix of SHAP values (# samples x # features)

    features : numpy.array or pandas.DataFrame
        Matrix of feature values (# samples x # features)

    feature_names : list
        Names of the features (length # features)

    display_features : numpy.array or pandas.DataFrame
        Matrix of feature values for visual display (such as strings instead of coded values)

    interaction_index : "auto", None, or int
        The index of the feature used to color the plot.
    """

    # convert from DataFrames if we got any
    if str(type(features)).endswith("'pandas.core.frame.DataFrame'>"):
        if feature_names is None:
            feature_names = features.columns
        features = features.values
    if str(type(display_features)).endswith("'pandas.core.frame.DataFrame'>"):
        if feature_names is None:
            feature_names = display_features.columns
        display_features = display_features.values
    elif display_features is None:
        display_features = features

    if feature_names is None:
        feature_names = [labels['FEATURE'] % str(i) for i in range(shap_values.shape[1] - 1)]

    # allow vectors to be passed
    if len(shap_values.shape) == 1:
        shap_values = np.reshape(shap_values, len(shap_values), 1)
    if len(features.shape) == 1:
        features = np.reshape(features, len(features), 1)

    def convert_name(ind):
        if type(ind) == str:
            nzinds = np.where(feature_names == ind)[0]
            if len(nzinds) == 0:
                print("Could not find feature named: " + ind)
                return None
            else:
                return nzinds[0]
        else:
            return ind

    ind = convert_name(ind)

    mpl_fig = pl.figure()

    # plotting SHAP interaction values
    if len(shap_values.shape) == 3 and len(ind) == 2:
        ind1 = convert_name(ind[0])
        ind2 = convert_name(ind[1])
        if ind1 == ind2:
            proj_shap_values = shap_values[:, ind2, :]
        else:
            proj_shap_values = shap_values[:, ind2, :] * 2  # off-diag values are split in half

        # TODO: remove recursion; generally the functions should be shorter for more maintainable code
        shap_dependence_plot(
            ind1, proj_shap_values, features, feature_names=feature_names,
            interaction_index=ind2, display_features=display_features, show=False
        )
        if ind1 == ind2:
            pl.ylabel(labels['MAIN_EFFECT'] % feature_names[ind1])
        else:
            pl.ylabel(labels['INTERACTION_EFFECT'] % (feature_names[ind1], feature_names[ind2]))

        # # if show:
        # #     pl.show()
        # return
        return mpl_fig

    # assert shap_values.shape[0] == features.shape[0], "'shap_values' and 'features' values must have the same number of rows!"
    # assert shap_values.shape[1] == features.shape[1] + 1, "'shap_values' must have one more column than 'features'!"

    # get both the raw and display feature values
    xv = features[:, ind]
    xd = display_features[:, ind]
    s = shap_values[:, ind]
    if type(xd[0]) == str:
        name_map = {}
        for i in range(len(xv)):
            name_map[xd[i]] = xv[i]
        xnames = list(name_map.keys())

    # allow a single feature name to be passed alone
    if type(feature_names) == str:
        feature_names = [feature_names]
    name = feature_names[ind]

    # guess what other feature as the stongest interaction with the plotted feature
    if interaction_index == "auto":
        interaction_index = approx_interactions(ind, shap_values, features)[0]
    interaction_index = convert_name(interaction_index)
    categorical_interaction = False

    # get both the raw and display color values
    if interaction_index is not None:
        cv = features[:, interaction_index]
        cd = display_features[:, interaction_index]
        clow = np.nanpercentile(features[:, interaction_index].astype(np.float), 5)
        chigh = np.nanpercentile(features[:, interaction_index].astype(np.float), 95)
        if type(cd[0]) == str:
            cname_map = {}
            for i in range(len(cv)):
                cname_map[cd[i]] = cv[i]
            cnames = list(cname_map.keys())
            categorical_interaction = True
        elif clow % 1 == 0 and chigh % 1 == 0 and len(set(features[:, interaction_index])) < 50:
            categorical_interaction = True

    # discritize colors for categorical features
    color_norm = None
    if categorical_interaction and clow != chigh:
        bounds = np.linspace(clow, chigh, chigh - clow + 2)
        color_norm = matplotlib.colors.BoundaryNorm(bounds, red_blue.N)

    # the actual scatter plot, TODO: adapt the dot_size to the number of data points?
    if interaction_index is not None:
        pl.scatter(xv, s, s=dot_size, linewidth=0, c=features[:, interaction_index], cmap=red_blue,
                   alpha=alpha, vmin=clow, vmax=chigh, norm=color_norm, rasterized=len(xv) > 500)
    else:
        pl.scatter(xv, s, s=dot_size, linewidth=0, color="#1E88E5",
                   alpha=alpha, rasterized=len(xv) > 500)

    if interaction_index != ind and interaction_index is not None:
        # draw the color bar
        if type(cd[0]) == str:
            tick_positions = [cname_map[n] for n in cnames]
            if len(tick_positions) == 2:
                tick_positions[0] -= 0.25
                tick_positions[1] += 0.25
            cb = pl.colorbar(ticks=tick_positions)
            cb.set_ticklabels(cnames)
        else:
            cb = pl.colorbar()

        cb.set_label(feature_names[interaction_index], size=13)
        cb.ax.tick_params(labelsize=11)
        if categorical_interaction:
            cb.ax.tick_params(length=0)
        cb.set_alpha(1)
        cb.outline.set_visible(False)
        bbox = cb.ax.get_window_extent().transformed(pl.gcf().dpi_scale_trans.inverted())
        cb.ax.set_aspect((bbox.height - 0.7) * 20)

    # make the plot more readable
    if interaction_index != ind:
        pl.gcf().set_size_inches(7.5, 5)
    else:
        pl.gcf().set_size_inches(6, 5)
    pl.xlabel(name, color=axis_color, fontsize=13)
    pl.ylabel(labels['VALUE_FOR'] % name, color=axis_color, fontsize=13)
    if title is not None:
        pl.title(title, color=axis_color, fontsize=13)
    pl.gca().xaxis.set_ticks_position('bottom')
    pl.gca().yaxis.set_ticks_position('left')
    pl.gca().spines['right'].set_visible(False)
    pl.gca().spines['top'].set_visible(False)
    pl.gca().tick_params(color=axis_color, labelcolor=axis_color, labelsize=11)
    for spine in pl.gca().spines.values():
        spine.set_edgecolor(axis_color)
    if type(xd[0]) == str:
        pl.xticks([name_map[n] for n in xnames], xnames, rotation='vertical', fontsize=11)
    # if show:
        # pl.show()
    return mpl_fig

I tried
return shap_dependence_plot(
            ind1, proj_shap_values, features, feature_names=feature_names,
            interaction_index=ind2, display_features=display_features, show=False
        )

but it still doesn't plot anything, and give the exact same error as before.

Hmmm...then I would have to dig through things for a bit to figure out what's up (which I can't do right now unfortunately). If you do end up figuring out what make matplotlib happy I am happy to merge a PR though :)

I've been banging my head on this for a while too.  It seems in a notebook the fig is always plotted regardless of the value of show.  This means you can't put the figure in a variable.
I could not find any faults in the SHAP code for this.
I did solve the problem I had and I think the below code is what did it.  I can't verify it because now when I remove that code it seems to work too - like these settings are stored in Jupyter permanently.
@PrashantSaikia Could you try pasting the below just after importing matplotlib.pyplot in your notebook and let me know if it helped?
plt.ioff() %matplotlib agg %matplotlib agg

@ihopethiswillfi Hey, sorry I had not been working on this for a long time now, but last week I had a  requirement to come back to SHAP. I tried your suggestion, but it didn't work. But I was finally able to make it work.
This is what I figured out. Instead of doing:
lis = []
for i in features:
    for j in features:
        mpl_fig = shap_dependence_plot ( (i, j), shap_interaction_values, X )
        plotly_fig = tls.mpl_to_plotly(mpl_fig)
        lis.append(plotly_fig)
lis

doing the following works:
lis = []
for i in features:
    for j in features:
        mpl_fig = pl.figure()
        ax = mpl_fig.add_subplot(111)
        shap_dependence_plot ( (i, j), shap_interaction_values, X )
        plotly_fig = tls.mpl_to_plotly(mpl_fig)
        lis.append(plotly_fig)

return lis

I don't know why, and I don't know how - I just know that its working now, after all these days spent hammering my head trying to get it to work.

tls

What is tls here?


Add: T/isPowerOf2

This patch resolves the following issues:

#109

It adds T/isPowerOf2 getters to:

BinaryInteger
DataInt<Element>
DataInt<Element>.Body
MutableDataInt<Element>
MutableDataInt<Element>.Body

Note that Count/isPowerOf2 was added in an earlier patch.

Count/isPowerOf2 does not use BinaryInteger/isPowerOf2 because the branching pattern is a bit different. Perhaps LLVM can figure that out and eliminate the would-be-duplicate comparison, but I'd have to measure it.

There are no representable infinite binary integer powers of 2. This is trivially true because UXL.max is defined such that UXL.max + 1 is a power of 2. So the arbitrary binary integer case is super simple.


gordon should not ask for uname

Every time someone creates an issue, gordon asks for uname -a output. This should not be necessary.
Either:

This output should be included in docker info (golang is capable of making the syscall to get this info: https://golang.org/pkg/syscall/#Uname)
This shouldn't be provided at all. docker info (and docker version) already includes the kernel version. What is it we're looking for from uname -a?

Hi!
Please read this important information about creating issues.
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.
This is an automated, informational response.
Thank you.
For more information about reporting issues, see https://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues

BUG REPORT INFORMATION
Use the commands below to provide key information from your environment:
docker version:
docker info:
uname -a:
Provide additional environment details (AWS, VirtualBox, physical, etc.):
List the steps to reproduce the issue:
1.
2.
3.
Describe the results you received:
Describe the results you expected:
Provide additional info you think is important:
----------END REPORT ---------
#ENEEDMOREINFO

Unfortunately, older versions of Docker didn't report this as part of docker info, so that's why it's still there.
We just need to decide when the times right to remove it from Gordon

Gordon should be smart enough to see it in the docker info / docker version output.
I image gordon is just regexing through the issue description, just need to tweak the regex (or add a fallback secondary regex).

@phemmer I'm absolutely +1 if this could be improved, and Gordon is made smarter. If you have ideas on improving this; Gordon can be found in in this repository; https://github.com/docker/leeroy
The code is quite simple, and this particular "detection" can be found here; https://github.com/docker/leeroy/blob/master/github/issue.go#L22


Update pydata sphinx theme

Hopefully I won't break anything with the test change.

Nice! thanks for this :-) one quick thought, I think we can now remove our custom previous/next templating and CSS, since we've now upstreamed that to the pydata theme:
https://github.com/executablebooks/sphinx-book-theme/blob/414e8bdb7f3caf39b1364548696afe5b7970e7e3/sphinx_book_theme/_templates/prev-next.html#L1-L30
any interest in trying that out as part of this?

any interest in trying that out as part of this?

Deleting code? YES! That is my favorite black hole to fall into. I'll report back if I crash and burn in the process.

think we can now remove our custom previous/next templating and CSS

To check, does it do translations?

BTW, can I get a hacktoberfest-accepted label ;-p

@chrisjsewell good catch, it looks like the original PR got modified before it was merged and the code needs tweaking. Will make a PR

if we wish to make the templating changes in this PR

That is up to you.

I think it's fine so long as we don't merge the PR. We can cut a new release on the pydata theme quickly so i think we can just get this one ready to go

I've just released a new version of the pydata theme (0.7.1) and bumped the patch version here. Let's see how it builds

@ocefpaf wanna try just adding some CSS to remove that yellow background? And then we should do a quick look over the kitchen sink docs to make sure nothing else has changed unexpectedly

I'm definitely out of my environment for that change. I'll probably just break it more. Sorry but CSS is a mystery to me.

Sounds good @ocefpaf - if you don't mind I'll push to this branch and we can merge it together

Sounds good @ocefpaf - if you don't mind I'll push to this branch and we can merge it together

Not at all. Push all the commits you need.

OK I think it looks correct now, but to give ourselves some time I just cut a release of the theme, and that should give a bit of extra time to make sure nothing is unexpectedly broken.


Best Practice

I love this vscode extension, thanks.
I was wondering, what is the best practice in terms of number of rest endpoints that can be added to a single http file? Is it better to have one http file per feature? 🤔
I'm just trying to keep things organized.

I can't give you a general recommendation. Depending on the service, a different structure may make sense. I have sometimes structured the files like CRUD (PUT => GET => PATCH, => DELETE) and executed them one after the other. In some cases, however, a create a test http file containing only one endpoint with several tests. I'm a fan of small files, so I avoid packing lots of requests into one file.
My current setup can be described as follows:

Separation between http files for testing and those for research/ debugging. I always forget to reset my changes when debugging.
Using HTTPYAC_ENV I globally inject the necessary variables for the different environments (dev,prod). I can quickly open a window at any time and send a request against a system in which I select the respective environment.
I inject the necessary authentication/header using a private plugin (HTTPYAC_PLUGIN). Again, the goal is that I can simply execute queries quickly (debugging)
Using snippets to generate often used payloads (e.g. OpenSearch Term query)
I also have a central git repository, for requests that I don't need often but don't want to forget, e.g Keycloak Administration, List all repositories of Gitlab Server,...


Filter register data via configuration

IMPORTANT: Where possible all PRs must be linked to a Github issue
Fixes #2764
Engineer Checklist

[x] I have written Unit tests for any new feature(s) and edge cases for bug fixes
[x] I have added any strings visible on UI components to the strings.xml file
[ ] I have updated the  CHANGELOG.md file for any notable changes to the codebase
[ ] I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
[x] I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
[ ] I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

[ ] I have verified Unit tests have been written for any new feature(s) and edge cases
[ ] I have verified any strings visible on UI components are in the strings.xml file
[ ] I have verifed the CHANGELOG.md file has any notable changes to the codebase
[ ] I have verified the solution has been implemented in a configurable and generic way for reuseable components
[ ] I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

looks great! merging...


Future forecast

Where are you get future forecast data? nomads.ncep.noaa.gov allows download only present or past data.

Each run contains several days of forecast data. Take a look here at the files containing the pattern FFF: http://www.nco.ncep.noaa.gov/pmb/products/gfs/

@cambecc  thanks Great Man


Reverse execution sequence after_each blocks

When I write spec with nested describe.
require "spec"

describe "Foo" do
  Spec.before_each do
    puts "Foo before_each"
  end

  Spec.after_each do
    puts "Foo after_each"
  end

  describe "Bar" do
    Spec.before_each do
      puts "Foo::Bar before_each"
    end

    Spec.after_each do
      puts "Foo::Bar after_each"
    end

    it "spec" do
      puts "spec"
    end
  end
end

Run this spec, after_each blocks execute in defined low-level order.'
$ crystal spec ./test.cr
Foo before_each
Foo::Bar before_each
spec
.Foo after_each
Foo::Bar after_each

Finished in 0.56 milliseconds
1 examples, 0 failures, 0 errors, 0 pending

I think it  executed in defined deep-level order.
$ .build/crystal spec ./test.cr
Foo before_each
Foo::Bar before_each
spec
.Foo::Bar after_each
Foo after_each

These hooks are global, there's no concept of nesting: https://carc.in/#/r/vk5
Maybe we can improve the documentation around this for now?

I understand we have no concept of nesting, thank you.


Spec compilation failure (read before assignment to local variable 'base')

Weird compile error is happening when running specs with a Crystal that was built with LLVM 6.0.1 on FreeBSD:
in macro 'macro_1343766128' /usr/home/greg/crystal/spec/std/file_spec.cr:587, line 8:

   1.
   2.       it "converts a pathname to an absolute pathname, using ~ (home) as base (trailing /)" do
   3.         prev_home = home
   4.         begin
   5.           ENV["HOME"] = File.expand_path(datapath)
   6.           File.expand_path("~/").should eq(home)
   7.           File.expand_path("~/..badfilename").should eq(File.join(home, "..badfilename"))
>  8.           File.expand_path("..").should eq("/#{base.split('/')[0...-1].join('/')}".gsub(/\A\/\//, "/"))

read before assignment to local variable 'base'

(base is a private function in the file, not a local variable)
/cc #5556

I'm also running into this on llvm 6.0.1 from Homebrew on macOS 10.13.5, will have to check with crystal compiled against llvm@5 (5.0.2).
I'll see if a full make clean helps, I only forced recompile of llvm_ext.o after switching from LLVM 5 to 6 because of patches required for 6.0.1.

The error message happens at the semantic stage, which has nothing to do with LLVM, so I really doubt it has anything to do with the LLVM version.

Yeah you are right, I'm also running into it when compiling with 5.0.2.
I also tried make clean and clearing out .crystal and ~/.cache/crystal as well as using the precompiled 0.25.1 binaries for compilation and the error persisted.

The error goes away if I remove the wrapping {% unless flag?(:win32) %} macro.

Oh and compiling the file_spec standalone also works, but all_spec fails (make spec).

I presume this has been resolved.


SPARQL response format

Hi!
What I'm trying to do is to integrate your SPARQL endpoint in our LinkedDataFragments server.
Is it possible to get a turtle, n3, or n-triples response from your endpoint? Seems like mime types in Accept-Header are ignored. The 'format' parameter only accepts xml and json. The only way I get some triple based response is with a construct query.
Cheers!

Hi,
Can I ask which kind of query are you running? I think a CONSTRUCT one, but just to be extra sure.
Another alternative would be to use directly the data available in the dumps (http://opencitations.net/download), that are in JSON-LD and would prevent the direct use of SPARQL.
What do you think?

Thanks for your response!
Using the dumps is not an alternative for me. I don't know if you are familiar with LinkedDataFragements. But @RubenVerborgh Server.js offers the possibility to integrate a SPARQL endpoint as a remote resource.
I figured out that the endpoint must support one of turtle, n3 or n.triples response (see https://github.com/LinkedDataFragments/Server.js/blob/f5dff0c55a7a46018014c70e12a1e689b0cd662a/lib/datasources/SparqlDatasource.js#L34) as my instance is giving me some error: "The endpoint returned an invalid Turtle response." At this point I didn't sent any query, but the server tries to find out how my triples the triples store contains and asks for the very first 100 triples like http://data.linkeddatafragments.org/viaf.
There is another issue which somehow tells me that integrating Blazegraph as a remote endpoint is possible.
I hope this lightens the context a little bit.
Cheers!


Improve Editor Page's MenuBar UI

The current UI looks too clumsy and does not go well with the rest of the web app
Redesign it and make it comparatively compact.

Sample References:

Google Docs/MS Word

@smaranjitghose please assign this issue to me

hey! I am interested to solve this issue. pls assign me this issue.


Bump version to v0.0.5-beta2

Signed-off-by: Alex Co<EMAIL_ADDRESS>
Summary

Ticket:
What's Changed

Changed.
Bump version to v0.0.5-beta2

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: onimsha
The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: jk-gan, onimsha
The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment