Releases: mihaiconstantin/parabar
Releases · mihaiconstantin/parabar
parabar v0.9.3
What's Changed
- Fix race conditions on Windows and add missing imports by @mihaiconstantin in #7
Changed
- Change type of private field
.bar_config
inProgressDecorator
class to
list
. This way, theconfigure_bar()
method ofProgressBar
class becomes
an optional step.
Fixed
- Implement file locking when logging progress from child processes to avoid
race conditions. The implementation is based on thefilelock
package. Closes
#8. - Fix typo in
DESCRIPTION
.
Full Changelog: v0.9.2...v0.9.3
parabar v0.9.2
What's Changed
- Fixes based on
CRAN
submission checks by @mihaiconstantin in #5
Fixed
- Update
man-roxygen/parabar.R
\html{...}
to fixHTML
validation errors. Closes #6. - Fix package description in
DESCRIPTION
file to comply withCRAN
requirements.
Full Changelog: v0.9.1...v0.9.2
parabar v0.9.1
What's Changed
- Minor fixes to prevent
CRAN
notes by @mihaiconstantin in #4
Fixed
- Update broken links in
README
file. - Disable examples for
par_sapply
exported function due to exceeding theCRAN
time limit for running examples.
Full Changelog: v0.9.0...v0.9.1
parabar v0.9.0
Added
- Add package website via
pkgdown
andGitHub
pages. - Add
GitHub
workflow to automatically check the package on several platforms andR
versions. - Export all
R6
classes as developer API and regenerate the namespace. - Add preliminary package documentation to
README
file. - Add exported wrapper
par_sapply
to run tasks in parallel and display a progress bar if appropriate. - Add exported wrapper
stop_backend
to stop a backend instance. - Add exported wrapper
start_backend
to create a backend instance based on the specified specification. - Add exported wrapper
configure_bar
for configuring the type and behavior of the progress bar. - Add exported wrapper
set_option
forHelper$set_option
. This function is available to end-users and can be used to set the value of a specific option. - Add helper method for setting package options. The static method
Helper$set_option
is a wrapper aroundbase::getOption
that sets the value of a specific option if it exists, or throws an error otherwise. - Add package object documentation and relevant information in
DESCRIPTION
file. - Add
parabar
logo startup message for interactiveR
sessions. - Add function to generate package logo based on the
ASCII
template ininst/assets/logo/parabar-logo.txt
. - Add exported wrapper
get_option
forHelper$get_option
. This function is available to end-users and can be used to get the value of a specific option or its default value. - Add helper method for getting package options or their defaults. The static method
Helper$get_option
is a wrapper aroundbase::getOption
that returns the value of a specific option if it exists, or the default value set by theOptions
class otherwise. - Add
Options
R6
class andset_default_options
function to manage package options forparabar
. The documented fields of theOptions
class represent the options that can be configured by the user. Theset_default_options
function can be used to set the default package options and is automatically run at package load time. In a nutshell,set_default_options
stores an instance ofOptions
in thebase::.Options
list under the keyparabar
. - Implement initial software design. From a helicopter view, the design consists of
backend
andcontext
objects. Abackend
represents a set of operations that can be deployed on a cluster produced byparallel::makeCluster
. The backend, therefore, interacts with the cluster via specific operations defined by theService
interface. Thecontext
represents the specific conditions in which the backend operations are invoked. A regular context object simply forwards the call to the corresponding backend method. However, a more complex context can augment the operation before invoking the backend operation. One example of a complex context is theProgressDecorator
class. This class extends the regularContext
class and decorates the backendsapply
operation to provide progress tracking and display a progress bar. - Add context classes to consume and decorate backend APIs. Since the context classes implement the
Service
interface, the client can interact with context objects as if they represents instances ofBackend
type. This release introduces the following contexts:Context
: represents a regular context that wraps backend objects. In other words, allService
methods calls implemented by this context are forwarded to the corresponding methods implemented by the backend object.ProgressDecorator
: represents a progress tracking context. This context decorates thesapply
method available on the backend instance to log the progress after each task execution and display a progress bar.ContextFactory
: represents a blueprint for obtaining specific context instances.
- Add classes to work with synchronous and asynchronous backends:
Service
: represents an interface that all concrete backends must implement. It contains the methods (i.e., operations) that can be requested from a given backend instance. These methods form the main API ofparabar
.Backend
: represents an abstract class that implements theService
interface. It contains fields and methods relevant to all concrete backend implementations that extend the class.SyncBackend
: represents a concrete implementation for a synchronous backend. When executing a task in parallel via thesapply
method, the caller process (i.e., usually the interactiveR
session) is blocked until the task finishes executing.AsyncBackend
: represents a concrete implementation for an asynchronous backend. After launching a task in parallel via thesapply
method, the method returns immediately leaving the caller process (e.g., the interactiveR
session) free. The computation of the task is offloaded to a permanent backgroundR
session. One can read the state of the task using the public field (i.e., active binding)task_state
. Furthermore, the results can be fetched from the background session using theget_output
method, which can either block the main process to wait for the results, or attempt to fetch them immediately and throw an error if not successful.Specification
: represents an auxiliary class that encapsulates the logic for determining the type of cluster to create (i.e., viaparallel::makeCluster
), and the number of nodes (i.e.,R
processes) for the cluster.TaskState
: represents an auxiliary class that encapsulates the logic for determining the state of a task.BackendFactory
: represents a blueprint for obtaining concrete backend implementations.
- Add
Helper
,Warning
, andException
R6
classes. These classes contain static member methods that provide useful utilities, handle warning messages, and throw informative errors, respectively. - Add
UML
diagram for package classes. The classes provided byparabar
can be split in three categories, namely (1) backend classes responsible for managing clusters, (2) context classes that decorate backend objects with additional functionality (e.g., progress tracking), and (3) progress bar classes providing a common interface for creating and interacting with various progress bars.