Skip to content

Commit 2b07a1d

Browse files
authored
Merge pull request #988 from Epistimio/release-0.2.6rc
Release Candidate v0.2.6
2 parents a262376 + a6010e9 commit 2b07a1d

File tree

12 files changed

+96
-33
lines changed

12 files changed

+96
-33
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ repos:
55
hooks:
66
- id: black
77
- repo: https://github.com/codespell-project/codespell
8-
rev: v2.1.0
8+
rev: v2.2.1
99
hooks:
1010
- id: codespell
11-
args: ["--skip", "*.html,*.ipynb,dashboard/src/.yarn/**,dashboard/build/**,dashboard/src/src/__tests__/**", "--ignore-words-list=hist,wont"]
11+
args: ["--skip", "*.html,*.ipynb,dashboard/src/.yarn/**,dashboard/src/yarn.lock,dashboard/build/**,dashboard/src/src/__tests__/**", "--ignore-words-list=hist,wont"]
1212
- repo: https://gitlab.com/pycqa/flake8
13-
rev: 3.9.2
13+
rev: 5.0.4
1414
hooks:
1515
- id: flake8
1616
args:
@@ -25,7 +25,7 @@ repos:
2525
- id: isort
2626
args: ["--profile", "black"]
2727
- repo: https://github.com/asottile/pyupgrade
28-
rev: v2.34.0
28+
rev: v2.37.3
2929
hooks:
3030
- id: pyupgrade
3131
args: ["--py37-plus"]

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ If you use Oríon for published work, please cite our work using the following b
118118

119119
.. code-block:: bibtex
120120
121-
@software{xavier_bouthillier_2022_0_2_5,
121+
@software{xavier_bouthillier_2022_0_2_6,
122122
author = {Xavier Bouthillier and
123123
Christos Tsirigotis and
124124
François Corneau-Tremblay and
@@ -146,7 +146,7 @@ If you use Oríon for published work, please cite our work using the following b
146146
month = august,
147147
year = 2022,
148148
publisher = {Zenodo},
149-
version = {v0.2.5},
149+
version = {v0.2.6,
150150
doi = {10.5281/zenodo.3478592},
151151
url = {https://doi.org/10.5281/zenodo.3478592}
152152
}

ROADMAP.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Roadmap
2-
Last update August 2nd, 2022
2+
Last update August 18th, 2022
33

44
## Next releases - Short-Term
55

6+
### v0.2.7
7+
68
### v0.2.6
79

10+
- Fix; make sure stdout from user script is printed back and not captured
11+
812
#### Simple dashboard specific to monitoring and benchmarking of Black-Box optimization
913
- Specific to hyper parameter optimizations
1014
- Provide status of experiments
@@ -13,6 +17,8 @@ Last update August 2nd, 2022
1317
Leveraging the knowledge base contained in the EVC of previous trials to optimize and drive new
1418
trials.
1519

20+
## Next releases - Mid-Term
21+
1622
## Next releases - Long-Term
1723

1824
#### Conditional Space

examples/plotting/plot_4_partial_dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
# parameters
6464
# <name>: <value>
6565
#
66-
# Even for a simple 2-d search space, the partial dependency is very useful. We see very cleary in this example
66+
# Even for a simple 2-d search space, the partial dependency is very useful. We see very clearly in this example
6767
# the optimal regions for both hyperparameters and we can see as well that the optimal region for
6868
# learning rates is larger when the dropout is low, and narrower when dropout approaches 0.5.
6969
#

src/orion/core/evc/conflicts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def try_resolve(self, conflict, *args, **kwargs):
267267
268268
Parameters
269269
----------
270-
conflict: `orion.ore.evc.conflicts.Conflict`
270+
conflict: `orion.core.evc.conflicts.Conflict`
271271
Conflict object to call `try_resolve`.
272272
silence_errors: bool
273273
If True, errors raised on execution of conflict.try_resolve will be caught and

src/orion/core/io/experiment_branch_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ExperimentBranchBuilder:
3333
Parameters
3434
----------
3535
conflicts: Conflicts
36-
Object reprenting a group of conflicts
36+
Object representing a group of conflicts
3737
manual_resolution: bool, optional
3838
Starts the prompt to resolve manually the conflicts. Use system's default if not provided.
3939
branch_from: str, optional

src/orion/core/worker/consumer.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,13 @@ def execute_process(self, cmd_args, environ):
253253

254254
try:
255255
# pylint: disable = consider-using-with
256-
process = subprocess.Popen(
257-
command,
258-
env=environ,
259-
stdout=subprocess.PIPE,
260-
stderr=subprocess.STDOUT,
261-
)
256+
process = subprocess.Popen(command, env=environ)
262257
except PermissionError as exc:
263258
log.debug("Script is not executable")
264259
raise InexecutableUserScript(" ".join(cmd_args)) from exc
265260

266-
stdout, _ = process.communicate()
267-
268261
return_code = process.wait()
269262
log.debug(f"Script finished with return code {return_code}")
270263

271264
if return_code != 0:
272-
log.debug("%s", stdout.decode("utf-8"))
273265
raise ExecutionError(return_code)

src/orion/storage/track.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,12 @@ def experiment(self):
150150
return self.storage.group_id
151151

152152
@property
153-
def hearbeat(self):
154-
"""See `~orion.core.worker.trial.Trial`"""
155-
return datetime.datetime.utcfromtimestamp(
156-
self.storage.metadata.get("heartbeat", 0)
157-
)
153+
def heartbeat(self):
154+
"""Trial Heartbeat"""
155+
heartbeat = self.storage.metadata.get("heartbeat")
156+
if heartbeat:
157+
return datetime.datetime.utcfromtimestamp(heartbeat)
158+
return None
158159

159160
@property
160161
def id(self):
@@ -311,14 +312,6 @@ def end_time(self, value):
311312
"""See `~orion.core.worker.trial.Trial`"""
312313
self.storage.metadata["end_time"] = value
313314

314-
@property
315-
def heartbeat(self):
316-
"""Trial Heartbeat"""
317-
heartbeat = self.storage.metadata.get("heartbeat")
318-
if heartbeat:
319-
return datetime.datetime.utcfromtimestamp(heartbeat)
320-
return None
321-
322315
@property
323316
def parents(self):
324317
"""See `~orion.core.worker.trial.Trial`"""

tests/functional/demo/black_box.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"""Simple one dimensional example for a possible user's script."""
33
import argparse
44
import os
5+
import sys
56

67
from orion.client import report_results
78

9+
PRINT = os.environ.get("ORION_PRINT", "False") == "True"
10+
811

912
def function(x):
1013
"""Evaluate partial information of a quadratic."""
@@ -14,6 +17,9 @@ def function(x):
1417

1518
def execute():
1619
"""Execute a simple pipeline as an example."""
20+
if PRINT:
21+
print("Start Child Process")
22+
1723
# 1. Receive inputs as you want
1824
parser = argparse.ArgumentParser()
1925
parser.add_argument("-x", type=float, required=True)
@@ -36,13 +42,19 @@ def execute():
3642
# 2. Perform computations
3743
y, dy = function(inputs.x)
3844

45+
if PRINT:
46+
print("Child Error", file=sys.stderr)
47+
3948
# 3. Gather and report results
4049
results = list()
4150
results.append(dict(name="example_objective", type="objective", value=y))
4251
results.append(dict(name="example_gradient", type="gradient", value=[dy]))
4352

4453
report_results(results)
4554

55+
if PRINT:
56+
print("End Child Process")
57+
4658

4759
if __name__ == "__main__":
4860
execute()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import os
2+
import sys
3+
4+
import orion
5+
import orion.core.cli
6+
from orion.testing import OrionState
7+
8+
9+
def main():
10+
"""This is needed because the user script runs in a separate process, so python
11+
cannot capture its output.
12+
13+
Here we run the entire orion script in its own process so we can capture all of its output.
14+
"""
15+
os.chdir(os.path.dirname(os.path.abspath(__file__)))
16+
17+
print("Start main process")
18+
os.environ["ORION_PRINT"] = "True"
19+
with OrionState():
20+
orion.core.cli.main(
21+
[
22+
"hunt",
23+
"-n",
24+
"default_algo",
25+
"--exp-max-trials",
26+
"5",
27+
"./black_box.py",
28+
"-x~uniform(0, 5, discrete=True)",
29+
]
30+
)
31+
32+
print("Main process Error", file=sys.stderr)
33+
print("End main process")
34+
35+
36+
if __name__ == "__main__":
37+
main()

0 commit comments

Comments
 (0)