Skip to content

Commit

Permalink
Port fixes from 1206ba2
Browse files Browse the repository at this point in the history
  • Loading branch information
dunnkers committed Jan 30, 2022
1 parent 333b36a commit 4d2e661
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions fseval/pipelines/_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def fit(self, X, y) -> AbstractEstimator:
assert n_jobs >= 1 or n_jobs == -1, f"incorrect `n_jobs`: {n_jobs}"

# remove callbacks this object and store locally in main thread.
callback_objects, callback_names = self.remove_and_get_callbacks()
callback_objects, callback_names = self._remove_and_get_callbacks()

# determine amount of CPU's to use. ALL if n_jobs is -1, else n_jobs.
cpus = multiprocessing.cpu_count() if n_jobs == -1 else n_jobs
Expand All @@ -155,7 +155,7 @@ def fit(self, X, y) -> AbstractEstimator:
pool.join()

# restore callbacks in main thread
self.set_callbacks(callback_objects, callback_names)
self._set_callbacks(callback_objects, callback_names)

# set collected estimators to this local object
self.estimators = estimators
Expand Down
1 change: 1 addition & 0 deletions website/docs/config/callbacks.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Callbacks
sidebar_position: 9
---


Expand Down
1 change: 1 addition & 0 deletions website/docs/config/metrics.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
sidebar_position: 8
title: Metrics
---

Expand Down
23 changes: 14 additions & 9 deletions website/src/components/AsciinemaPlayer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useRef } from 'react';
import * as AsciinemaPlayerLibrary from 'asciinema-player';
import BrowserOnly from '@docusaurus/BrowserOnly';

type AsciinemaPlayerProps = {
src: string;
Expand All @@ -22,15 +22,20 @@ type AsciinemaPlayerProps = {
const AsciinemaPlayer: React.FC<AsciinemaPlayerProps> = ({
src,
...asciinemaOptions
}) => {
const ref = useRef<HTMLDivElement>(null);
}) => (
<BrowserOnly>
{() => {
const AsciinemaPlayerLibrary = require('asciinema-player');
const ref = useRef<HTMLDivElement>(null);

useEffect(() => {
const currentRef = ref.current;
AsciinemaPlayerLibrary.create(src, currentRef, asciinemaOptions);
}, [src]);
useEffect(() => {
const currentRef = ref.current;
AsciinemaPlayerLibrary.create(src, currentRef, asciinemaOptions);
}, [src]);

return <div ref={ref} />;
};
return <div ref={ref} />;
}}
</BrowserOnly>
)

export default AsciinemaPlayer;

0 comments on commit 4d2e661

Please sign in to comment.