nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: actions/toolkit
Pull request #1318 (2023-01-24 01:31:45)

Pass in the current workspace as a parameter to hashFiles
Follow up work to allow the runner to use the hashFiles implementation in glob



Patch:
diff --git a/packages/glob/src/glob.ts b/packages/glob/src/glob.ts
index acbb6d2..3c68de8 100644
--- a/packages/glob/src/glob.ts
+++ b/packages/glob/src/glob.ts
@@ -22,10 +22,13 @@ export async function create(
  * Computes the sha256 hash of a glob
  *
  * @param patterns  Patterns separated by newlines
+ * @param currentWorkspace  Workspace used when matching files
  * @param options   Glob options
+ * @param verbose   Enables verbose logging
  */
 export async function hashFiles(
   patterns: string,
+  currentWorkspace = '',
   options?: HashFileOptions,
   verbose: Boolean = false
 ): Promise<string> {
@@ -34,5 +37,5 @@ export async function hashFiles(
     followSymbolicLinks = options.followSymbolicLinks
   }
   const globber = await create(patterns, {followSymbolicLinks})
-  return _hashFiles(globber, verbose)
+  return _hashFiles(globber, currentWorkspace, verbose)
 }
diff --git a/packages/glob/src/internal-hash-files.ts b/packages/glob/src/internal-hash-files.ts
index ef18d9f..d968db5 100644
--- a/packages/glob/src/internal-hash-files.ts
+++ b/packages/glob/src/internal-hash-files.ts
@@ -8,11 +8,14 @@ import {Globber} from './glob'
 
 export async function hashFiles(
   globber: Globber,
+  currentWorkspace: string,
   verbose: Boolean = false
 ): Promise<string> {
   const writeDelegate = verbose ? core.info : core.debug
   let hasMatch = false
-  const githubWorkspace = process.env['GITHUB_WORKSPACE'] ?? process.cwd()
+  const githubWorkspace = currentWorkspace
+    ? currentWorkspace
+    : process.env['GITHUB_WORKSPACE'] ?? process.cwd()
   const result = crypto.createHash('sha256')
   let count = 0
   for await (const file of globber.globGenerator()) {


Test patch:
diff --git a/packages/glob/__tests__/hash-files.test.ts b/packages/glob/__tests__/hash-files.test.ts
index cb912ca..51ed3ee 100644
--- a/packages/glob/__tests__/hash-files.test.ts
+++ b/packages/glob/__tests__/hash-files.test.ts
@@ -51,6 +51,7 @@ describe('globber', () => {
     )
   })
 
+  const emptyDirectory = ''
   it('followSymbolicLinks set to true', async () => {
     const root = path.join(getTestTemp(), 'set-to-true')
     await fs.mkdir(path.join(root, 'realdir'), {recursive: true})
@@ -60,7 +61,9 @@ describe('globber', () => {
       path.join(root, 'symDir')
     )
     const testPath = path.join(root, `symDir`)
-    const hash = await hashFiles(testPath, {followSymbolicLinks: true})
+    const hash = await hashFiles(testPath, emptyDirectory, {
+      followSymbolicLinks: true
+    })
     expect(hash).toEqual(
       'd8a411e8f8643821bed189e627ff57151918aa554c00c10b31c693ab2dded273'
     )
@@ -80,7 +83,9 @@ describe('globber', () => {
       path.join(root, 'symDir')
     )
     const testPath = path.join(root, 'symdir')
-    const hash = await hashFiles(testPath, {followSymbolicLinks: false})
+    const hash = await hashFiles(testPath, emptyDirectory, {
+      followSymbolicLinks: false
+    })
     expect(hash).toEqual('')
   })
Repository: actions/toolkit
Pull request #1355 (2023-02-23 17:06:35)

Support '*' wildcard in `no_proxy`


Patch:
diff --git a/packages/http-client/src/proxy.ts b/packages/http-client/src/proxy.ts
index e4e43a5..3c84c58 100644
--- a/packages/http-client/src/proxy.ts
+++ b/packages/http-client/src/proxy.ts
@@ -52,6 +52,7 @@ export function checkBypass(reqUrl: URL): boolean {
     .map(x => x.trim().toUpperCase())
     .filter(x => x)) {
     if (
+      upperNoProxyItem === '*' ||
       upperReqHosts.some(
         x =>
           x === upperNoProxyItem ||


Test patch:
diff --git a/packages/http-client/__tests__/proxy.test.ts b/packages/http-client/__tests__/proxy.test.ts
index ccbceec..60077a5 100644
--- a/packages/http-client/__tests__/proxy.test.ts
+++ b/packages/http-client/__tests__/proxy.test.ts
@@ -176,11 +176,16 @@ describe('proxy', () => {
     expect(bypass).toBeTruthy()
   })
 
-  // Do not match wildcard ("*") as per https://github.com/actions/runner/blob/97195bad5870e2ad0915ebfef1616083aacf5818/docs/adrs/0263-proxy-support.md
   it('checkBypass returns true if no_proxy is "*"', () => {
     process.env['no_proxy'] = '*'
     const bypass = pm.checkBypass(new URL('https://anything.whatsoever.com'))
-    expect(bypass).toBeFalsy()
+    expect(bypass).toBeTruthy()
+  })
+
+  it('checkBypass returns true if no_proxy contains comma separated "*"', () => {
+    process.env['no_proxy'] = 'domain.com,* , example.com'
+    const bypass = pm.checkBypass(new URL('https://anything.whatsoever.com'))
+    expect(bypass).toBeTruthy()
   })
 
   it('HttpClient does basic http get request through proxy', async () => {
Repository: actions/toolkit
Pull request #1361 (2023-03-01 13:54:31)

Bypass proxy on loopback IPs (localhost, 127.*, ::1 etc)
Requests to localhost should not be proxied (if the proxy is on another device / network, the proxied request targeting 'localhost' will likely be lost)

The [runner](https://github.com/actions/runner/blob/5421fe3f7107f770c904ed4c7e506ae7a5cde2c2/src/Runner.Sdk/RunnerWebProxy.cs#L203) also ignores loopback IPs
[Golang as well](https://go.dev/src/vendor/golang.org/x/net/http/httpproxy/proxy.go?s=4195:4265#:~:text=if%20ip.IsLoopback,%7D)


Patch:
diff --git a/packages/http-client/src/proxy.ts b/packages/http-client/src/proxy.ts
index e4e43a5..8727dfd 100644
--- a/packages/http-client/src/proxy.ts
+++ b/packages/http-client/src/proxy.ts
@@ -25,6 +25,11 @@ export function checkBypass(reqUrl: URL): boolean {
     return false
   }
 
+  const reqHost = reqUrl.hostname
+  if (isLoopbackAddress(reqHost)) {
+    return true
+  }
+
   const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''
   if (!noProxy) {
     return false
@@ -66,3 +71,13 @@ export function checkBypass(reqUrl: URL): boolean {
 
   return false
 }
+
+function isLoopbackAddress(host: string): boolean {
+  const hostLower = host.toLowerCase()
+  return (
+    hostLower === 'localhost' ||
+    hostLower.startsWith('127.') ||
+    hostLower.startsWith('[::1]') ||
+    hostLower.startsWith('[0:0:0:0:0:0:0:1]')
+  )
+}


Test patch:
diff --git a/packages/http-client/__tests__/proxy.test.ts b/packages/http-client/__tests__/proxy.test.ts
index ccbceec..aa3370d 100644
--- a/packages/http-client/__tests__/proxy.test.ts
+++ b/packages/http-client/__tests__/proxy.test.ts
@@ -237,6 +237,31 @@ describe('proxy', () => {
     expect(_proxyConnects).toHaveLength(0)
   })
 
+  it('HttpClient bypasses proxy for loopback addresses (localhost, ::1, 127.*)', async () => {
+    // setup a server listening on localhost:8091
+    const server = http.createServer((request, response) => {
+      response.writeHead(200)
+      request.pipe(response)
+    })
+    server.listen(8091)
+    try {
+      process.env['http_proxy'] = _proxyUrl
+      const httpClient = new httpm.HttpClient()
+      let res = await httpClient.get('http://localhost:8091')
+      expect(res.message.statusCode).toBe(200)
+      res = await httpClient.get('http://127.0.0.1:8091')
+      expect(res.message.statusCode).toBe(200)
+
+      // no support for ipv6 for now
+      expect(httpClient.get('http://[::1]:8091')).rejects.toThrow()
+
+      // proxy at _proxyUrl was ignored
+      expect(_proxyConnects).toEqual([])
+    } finally {
+      server.close()
+    }
+  })
+
   it('proxyAuth not set in tunnel agent when authentication is not provided', async () => {
     process.env['https_proxy'] = 'http://127.0.0.1:8080'
     const httpClient = new httpm.HttpClient()
Repository: actions/toolkit
Pull request #1430 (2023-05-25 10:05:09)

Update docs for setSecret
As a follow up to https://github.com/actions/toolkit/issues/1421 we've conducted testing that proved that `setSecret` does in fact mask multi line secrets (and so does `::add-mask::` as long as a multi-line string is escaped). This updates the docs to reflect that and adds a test to ensure `setSecret` does escape the string it's being passed.


Patch:
diff --git a/docs/commands.md b/docs/commands.md
index c711368..15f18e8 100644
--- a/docs/commands.md
+++ b/docs/commands.md
@@ -50,7 +50,18 @@ function setSecret(secret: string): void {}
 
 Now, future logs containing BAR will be masked. E.g. running `echo "Hello FOO BAR World"` will now print `Hello FOO **** World`.
 
-**WARNING** The add-mask and setSecret  commands only support single line secrets. To register a multiline secrets you must register each line individually otherwise it will not be masked.
+**WARNING** The add-mask and setSecret commands only support single-line
+secrets or multi-line secrets that have been escaped. `@actions/core`
+`setSecret` will escape the string you provide by default. When an escaped
+multi-line string is provided the whole string and each of its lines
+individually will be masked. For example you can mask `first\nsecond\r\nthird`
+using:
+
+```sh
+echo "::add-mask::first%0Asecond%0D%0Athird"
+```
+
+This will mask `first%0Asecond%0D%0Athird`, `first`, `second` and `third`.
 
 **WARNING** Do **not** mask short values if you can avoid it, it could render your output unreadable (and future steps' output as well).
 For example, if you mask the letter `l`, running `echo "Hello FOO BAR World"` will now print `He*********o FOO BAR Wor****d`


Test patch:
diff --git a/packages/core/__tests__/core.test.ts b/packages/core/__tests__/core.test.ts
index 5011fcc..09bc587 100644
--- a/packages/core/__tests__/core.test.ts
+++ b/packages/core/__tests__/core.test.ts
@@ -161,7 +161,11 @@ describe('@actions/core', () => {
 
   it('setSecret produces the correct command', () => {
     core.setSecret('secret val')
-    assertWriteCalls([`::add-mask::secret val${os.EOL}`])
+    core.setSecret('multi\nline\r\nsecret')
+    assertWriteCalls([
+      `::add-mask::secret val${os.EOL}`,
+      `::add-mask::multi%0Aline%0D%0Asecret${os.EOL}`
+    ])
   })
 
   it('prependPath produces the correct commands and sets the env', () => {
Repository: actions/toolkit
Pull request #1439 (2023-06-20 12:37:27)

Prepend http:// to http(s)_proxy env if missing


Patch:
diff --git a/packages/http-client/src/proxy.ts b/packages/http-client/src/proxy.ts
index 1a967e3..32afce6 100644
--- a/packages/http-client/src/proxy.ts
+++ b/packages/http-client/src/proxy.ts
@@ -14,7 +14,12 @@ export function getProxyUrl(reqUrl: URL): URL | undefined {
   })()
 
   if (proxyVar) {
-    return new URL(proxyVar)
+    try {
+      return new URL(proxyVar)
+    } catch {
+      if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
+        return new URL(`http://${proxyVar}`)
+    }
   } else {
     return undefined
   }


Test patch:
diff --git a/packages/http-client/__tests__/proxy.test.ts b/packages/http-client/__tests__/proxy.test.ts
index 97cf785..1a0e28a 100644
--- a/packages/http-client/__tests__/proxy.test.ts
+++ b/packages/http-client/__tests__/proxy.test.ts
@@ -91,6 +91,12 @@ describe('proxy', () => {
     expect(proxyUrl).toBeDefined()
   })
 
+  it('getProxyUrl returns proxyUrl if http_proxy has no protocol', () => {
+    process.env['http_proxy'] = 'myproxysvr'
+    const proxyUrl = pm.getProxyUrl(new URL('http://github.com'))
+    expect(proxyUrl?.toString()).toBe('http://myproxysvr/')
+  })
+
   it('checkBypass returns true if host as no_proxy list', () => {
     process.env['no_proxy'] = 'myserver'
     const bypass = pm.checkBypass(new URL('https://myserver'))
Repository: SwitchbackTech/compass
Pull request #375 (2025-04-22 19:55:18)

fix(web): replace move to sidebar shortcut hotkey
## Description

Closes https://github.com/SwitchbackTech/compass/issues/350

the current hotkey combination did not work. This new combination is simpler and guaranteed to work (for english keyboard layouts)


Patch:
diff --git a/packages/web/src/views/Forms/EventForm/EventForm.tsx b/packages/web/src/views/Forms/EventForm/EventForm.tsx
index 7a9efb55..5495b409 100644
--- a/packages/web/src/views/Forms/EventForm/EventForm.tsx
+++ b/packages/web/src/views/Forms/EventForm/EventForm.tsx
@@ -204,7 +204,7 @@ export const EventForm: React.FC<FormProps> = ({
   };
 
   useHotkeys(
-    "meta+shift+<",
+    "meta+[",
     () => {
       onConvert?.();
     },
diff --git a/packages/web/src/views/Forms/EventForm/MoveToSidebarButton.tsx b/packages/web/src/views/Forms/EventForm/MoveToSidebarButton.tsx
index 71e3fed2..590cb260 100644
--- a/packages/web/src/views/Forms/EventForm/MoveToSidebarButton.tsx
+++ b/packages/web/src/views/Forms/EventForm/MoveToSidebarButton.tsx
@@ -16,8 +16,7 @@ export const MoveToSidebarButton = ({ onClick }: { onClick: () => void }) => {
 
     return (
       <Text size="m" style={{ display: "flex", alignItems: "center" }}>
-        {isMacOS ? <Command size={16} /> : <WindowsLogo size={16} />} + SHIFT +
-        {"<"}
+        {isMacOS ? <Command size={16} /> : <WindowsLogo size={16} />} +{"["}
       </Text>
     );
   };


Test patch:
diff --git a/packages/web/src/views/Forms/EventForm/EventForm.test.tsx b/packages/web/src/views/Forms/EventForm/EventForm.test.tsx
index b6b5f410..1a128266 100644
--- a/packages/web/src/views/Forms/EventForm/EventForm.test.tsx
+++ b/packages/web/src/views/Forms/EventForm/EventForm.test.tsx
@@ -74,8 +74,8 @@ test("should call onConvert when meta+shift+< keyboard shortcut is used", async
   expect(screen.getByRole("form")).toBeInTheDocument();
 
   await act(async () => {
-    // Simulate pressing Meta, then Shift, then '<', then releasing them
-    await userEvent.keyboard("{Meta>}{Shift>}{<}{/Shift}{/Meta}");
+    // Simulate pressing Meta, then '[', then releasing them
+    await userEvent.keyboard("{Meta>}{[}{/Meta}");
   });
 
   expect(mockOnConvert).toHaveBeenCalledTimes(1);
Repository: PMEAL/OpenPNM
Pull request #1231 (2019-04-09 15:22:28)

Fix find neighbor bonds
This PR addresses issue #1230.


Patch:
diff --git a/example_PNP.py b/example_PNP.py
index f0e2c9136..b3021a227 100644
--- a/example_PNP.py
+++ b/example_PNP.py
@@ -1,10 +1,10 @@
+"""
 import openpnm as op
 import numpy as np
 ws = op.Workspace()
 proj = ws.new_project()
 # ws.settings['loglevel'] = 20
 
-
 # network, geometry, phase
 np.random.seed(0)
 
@@ -116,3 +116,4 @@ sw.update(p.results())
 sw.update(eA.results())
 sw.update(eB.results())
 # op.io.VTK.save(network=net, phases=[sw], filename='OUTPUT_PNP')
+"""
diff --git a/openpnm/topotools/topotools.py b/openpnm/topotools/topotools.py
index c4f986826..8381e6025 100644
--- a/openpnm/topotools/topotools.py
+++ b/openpnm/topotools/topotools.py
@@ -215,7 +215,7 @@ def find_neighbor_bonds(sites, im=None, am=None, flatten=True, logic='or'):
             am = sp.sparse.triu(am, k=1)
         if flatten is False:
             raise Exception('flatten cannot be used with an adjacency matrix')
-        Ps = sp.zeros(max(am.row.max(), am.col.max())+1, dtype=bool)
+        Ps = sp.zeros(am.shape[0], dtype=bool)
         Ps[sites] = True
         conns = sp.vstack((am.row, am.col)).T
         if logic in ['or', 'union', 'any']:


Test patch:
diff --git a/tests/unit/network/GenericNetworkTest.py b/tests/unit/network/GenericNetworkTest.py
index b55dbe400..4b828d0e0 100644
--- a/tests/unit/network/GenericNetworkTest.py
+++ b/tests/unit/network/GenericNetworkTest.py
@@ -79,6 +79,13 @@ class GenericNetworkTest:
                                          include_input=True)
         assert sp.all(a == [0, 1, 2, 10, 11, 100, 101])
 
+    def test_find_neighbor_throats_on_pores_wo_throats(self):
+        net = op.network.Cubic(shape=[10, 10, 1])
+        ts = net.find_neighbor_throats(pores=net.Ps[-1])
+        op.topotools.trim(net, throats=ts)
+        ts2 = net.find_neighbor_throats(pores=99)
+        assert ts2.size == 0
+
     def test_find_neighbor_throats_empty(self):
         a = self.net.find_neighbor_throats(pores=[])
         assert sp.size(a) == 0
Repository: PMEAL/OpenPNM
Pull request #1307 (2019-07-09 02:42:25)

Added option to set default regen_mode as a setting during instantiation


Patch:
diff --git a/openpnm/core/ModelsMixin.py b/openpnm/core/ModelsMixin.py
index 5a457da28..786d9d8c9 100644
--- a/openpnm/core/ModelsMixin.py
+++ b/openpnm/core/ModelsMixin.py
@@ -206,7 +206,7 @@ class ModelsMixin():
 
     """
 
-    def add_model(self, propname, model, regen_mode='normal', **kwargs):
+    def add_model(self, propname, model, regen_mode='', **kwargs):
         r"""
         Adds a new model to the models dictionary (``object.models``)
 
@@ -222,8 +222,8 @@ class ModelsMixin():
             Controls how/when the model is run (See Notes for more details).
             Options are:
 
-            *'normal'* : The model is run directly upon being assiged, and
-            also run every time ``regenerate_models`` is called.
+            *'normal'* : (default) The model is run directly upon being
+            assiged, and also run every time ``regenerate_models`` is called.
 
             *'constant'* : The model is run directly upon being assigned, but
             is not called again, thus making it's data act like a constant.
@@ -236,6 +236,12 @@ class ModelsMixin():
         """
         if propname in kwargs.values():  # Prevent infinite loops of look-ups
             raise Exception(propname+' can\'t be both dependency and propname')
+        # Look for default regen_mode in settings if present, else use 'normal'
+        if regen_mode == '':
+            if 'regen_mode' in self.settings.keys():
+                regen_mode = self.settings['regen_mode']
+            else:
+                regen_mode = 'normal'
         # Add model and regen_mode to kwargs dictionary
         kwargs.update({'model': model, 'regen_mode': regen_mode})
         # Insepct model to extract arguments and default values


Test patch:
diff --git a/tests/unit/core/ModelsTest.py b/tests/unit/core/ModelsTest.py
index bf1ae86ad..ba2317edd 100644
--- a/tests/unit/core/ModelsTest.py
+++ b/tests/unit/core/ModelsTest.py
@@ -159,6 +159,14 @@ class ModelsTest:
         pn.regenerate_models(deep=True)
         assert len(geo.props()) == b
 
+    def test_regen_mode_default_value(self):
+        pn = op.network.Cubic(shape=[3, 3, 3], spacing=1e-4)
+        geo = op.geometry.StickAndBall(network=pn, pores=pn.Ps, throats=pn.Ts,
+                                       settings={'regen_mode': 'deferred'})
+        assert len(geo.props()) == 0
+        geo.regenerate_models()
+        assert len(geo.props()) == 16
+
 
 if __name__ == '__main__':
Repository: PMEAL/OpenPNM
Pull request #1329 (2019-09-20 03:40:25)

Fixed bug that put 0 instead of nans in new pores


Patch:
diff --git a/openpnm/topotools/topotools.py b/openpnm/topotools/topotools.py
index 5e24b1d10..fa04b4f93 100644
--- a/openpnm/topotools/topotools.py
+++ b/openpnm/topotools/topotools.py
@@ -1110,7 +1110,10 @@ def extend(network, pore_coords=[], throat_conns=[], labels=[]):
             N = network._count(element=item.split('.')[0])
             arr = network.pop(item)
             s = arr.shape
-            network[item] = sp.zeros(shape=(N, *s[1:]), dtype=arr.dtype)
+            if arr.dtype == bool:
+                network[item] = sp.zeros(shape=(N, *s[1:]), dtype=bool)
+            else:
+                network[item] = sp.ones(shape=(N, *s[1:]), dtype=float)*sp.nan
             # This is a temporary work-around until I learn to handle 2+ dims
             network[item][:arr.shape[0]] = arr
 


Test patch:
diff --git a/tests/unit/topotools/TopotoolsTest.py b/tests/unit/topotools/TopotoolsTest.py
index 470862a93..dfd3b5761 100644
--- a/tests/unit/topotools/TopotoolsTest.py
+++ b/tests/unit/topotools/TopotoolsTest.py
@@ -294,6 +294,14 @@ class TopotoolsTest:
         coords = [[0, 0, 0], [0, 1, 2], [0, 2, 1], [0, 3, 3], [1, 1, 2]]
         assert ~topotools.iscoplanar(coords)
 
+    def test_extend(self):
+        pn = op.network.Cubic(shape=[2, 2, 1])
+        pn['pore.test'] = 1.0
+        op.topotools.add_boundary_pores(network=pn, pores=pn.pores('left'),
+                                        move_to=[0, None, None],
+                                        apply_label='left')
+        assert np.any(np.isnan(pn['pore.test']))
+
 
 if __name__ == '__main__':
Repository: PMEAL/OpenPNM
Pull request #1416 (2020-03-03 06:32:00)

Fix1408 throat models break with no throats
The from_neighbor_pores model was breaking on domains that had no throats...now fixed.


Patch:
diff --git a/openpnm/models/misc/neighbor_lookups.py b/openpnm/models/misc/neighbor_lookups.py
index 59892761c..9617da024 100644
--- a/openpnm/models/misc/neighbor_lookups.py
+++ b/openpnm/models/misc/neighbor_lookups.py
@@ -92,19 +92,22 @@ def from_neighbor_pores(target, prop=None, pore_prop='pore.seed', mode='min',
 
     """
     prj = target.project
+    lookup = prj.find_full_domain(target)
     network = prj.network
     throats = network.map_throats(target.throats(), target)
     P12 = network.find_connected_pores(throats)
-    lookup = prj.find_full_domain(target)
     if prop is not None:
         pore_prop = prop
     pvalues = lookup[pore_prop][P12]
     if ignore_nans:
         pvalues = np.ma.MaskedArray(data=pvalues, mask=np.isnan(pvalues))
-    if mode == 'min':
-        value = np.amin(pvalues, axis=1)
-    if mode == 'max':
-        value = np.amax(pvalues, axis=1)
-    if mode == 'mean':
-        value = np.mean(pvalues, axis=1)
+    try:  # If pvalues is not empty
+        if mode == 'min':
+            value = np.amin(pvalues, axis=1)
+        if mode == 'max':
+            value = np.amax(pvalues, axis=1)
+        if mode == 'mean':
+            value = np.mean(pvalues, axis=1)
+    except np.AxisError:  # Handle case of empty pvalues
+        value = []
     return np.array(value)


Test patch:
diff --git a/tests/integration/MultidomainTest.py b/tests/integration/MultidomainTest.py
index a5c317802..2a5dfd08e 100644
--- a/tests/integration/MultidomainTest.py
+++ b/tests/integration/MultidomainTest.py
@@ -28,6 +28,20 @@ class MultipleDomainTest():
         Ts = ~pn['throat.geo_01']
         geo2 = op.geometry.StickAndBall(network=pn, pores=range(1, 27), throats=Ts)
 
+    def test_multiple_domain_all_throats_in_one_domain(self):
+        pn = op.network.Cubic(shape=[3, 3, 1])
+        Ps = pn['pore.coords'][:, 0] > 0.5
+        geo1 = op.geometry.StickAndBall(network=pn, pores=Ps, throats=pn.Ts)
+        Ps = pn['pore.coords'][:, 0] <= 0.5
+        geo2 = op.geometry.StickAndBall(network=pn, pores=Ps)
+
+    def test_multiple_domain_all_throats_in_other_domain(self):
+        pn = op.network.Cubic(shape=[3, 3, 1])
+        Ps = pn['pore.coords'][:, 0] > 0.5
+        geo1 = op.geometry.StickAndBall(network=pn, pores=Ps)
+        Ps = pn['pore.coords'][:, 0] <= 0.5
+        geo2 = op.geometry.StickAndBall(network=pn, pores=Ps, throats=pn.Ts)
+
 
 if __name__ == '__main__':