Skip to content

Commit

Permalink
Merge pull request #26 from joezuntz/remove-future
Browse files Browse the repository at this point in the history
Remove dependency on future module
  • Loading branch information
joezuntz authored Jun 1, 2022
2 parents 576035e + 5664466 commit eb63fcc
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 15 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ jobs:
password: ${{ secrets.PYPI_COSMOSIS_UPLOAD }}

- name: Make PR on cosmosis conda forge feedstock
uses: joezuntz/cosmosis-action@v0.3
uses: joezuntz/conda-forge-feedstock-pr-action@v0.6
with:
feedstock_name: cosmosis
token: ${{ secrets.PR_MAKER_TOKEN }}
which-repository: cosmosis
version: ${{ steps.build_tarball.outputs.pypi-version }}
hash: ${{ steps.build_tarball.outputs.tarball-sha }}
fork_owner: joezuntz
email_address: [email protected]
6 changes: 2 additions & 4 deletions cosmosis/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ def demo_10_special (args):
print()
print("There are two flavours of this demo, selected through an ")
print("environment variable called `HALOFIT'; this variable is not ")
print("currently set, so we are giving it the value `halofit'.")
print("Please see the wiki for more information: ")
print("https://bitbucket.org/joezuntz/cosmosis/wiki/Demo10.")
print("currently set, so we are giving it the value `takahashi'.")

os.environ ["HALOFIT"] = "halofit"
os.environ ["HALOFIT"] = "takahashi"



Expand Down
1 change: 0 additions & 1 deletion cosmosis/output/output_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
import numpy as np
import fcntl
from future.utils import with_metaclass
import datetime
import os

Expand Down
3 changes: 1 addition & 2 deletions cosmosis/postprocessing/cosmology_theory_plots.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from future.utils import with_metaclass
import os
import argparse
import numpy as np
Expand Down Expand Up @@ -44,7 +43,7 @@ def __new__(meta, name, bases, class_dict):
meta.registry -= set(bases)
return cls

class Plot(with_metaclass(RegisteredPlot, object)):
class Plot(metaclass=RegisteredPlot):
#Subclasses should override this to specify the base
#part of their filename
filename = "error"
Expand Down
3 changes: 1 addition & 2 deletions cosmosis/postprocessing/postprocess_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from ..runtime.config import Inifile
import imp
import os
from future.utils import with_metaclass
postprocessor_registry = {}

from io import StringIO
Expand All @@ -20,7 +19,7 @@ def __init__(cls, name, b, d):
if d is None: return
postprocessor_registry[sampler] = cls

class PostProcessor(with_metaclass(PostProcessMetaclass, object)):
class PostProcessor(metaclass=PostProcessMetaclass):
sampler=None
cosmosis_standard_output=True
def __init__(self, ini, label, index, **options):
Expand Down
5 changes: 2 additions & 3 deletions cosmosis/samplers/sampler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from future.utils import with_metaclass
from ..runtime.attribution import PipelineAttribution
from ..runtime.utils import get_git_revision
from ..runtime import Inifile
Expand Down Expand Up @@ -30,7 +29,7 @@ def __new__(meta, name, bases, class_dict):
else:
raise ValueError("Sampler classes must be named [Name]Sampler")

class Sampler(with_metaclass(RegisteredSampler, object)):
class Sampler(metaclass=RegisteredSampler):
needs_output = True
sampler_outputs = []
understands_fast_subspaces = False
Expand Down Expand Up @@ -86,7 +85,7 @@ def collect_run_metadata(self):
if save_username:
info['hostname'] = platform.node()
info['username'] = getpass.getuser()

info['workdir'] = os.getcwd()

return info

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def run(self):

requirements = [
"pyyaml",
"future",
"emcee",
"numpy",
"scipy",
Expand Down

0 comments on commit eb63fcc

Please sign in to comment.